Skip to content

Commit

Permalink
http_client Add debug and some notes in TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
oej committed Mar 30, 2016
1 parent f1a071a commit c3c4788
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions modules/http_client/TODO.txt
Expand Up @@ -13,6 +13,9 @@ The http_client module - todo
- save fingerprint of cert for trust-on-first-use procedure

- connection and last status for httpcon-object, needs to be object in process memory, so child_init
Note: Right now httpcon-objects are allocated in pkg memory. This is bad for a reload,
but good for what we need to do here.
- test what happens if we allocate curlcon objects in shared memory and use locks
- if 5xx response or timeout set flag
- function in dialplan - httpcon_exists(object)
- pv $curlstatus(object) ??
Expand Down
8 changes: 6 additions & 2 deletions modules/http_client/http_client.c
@@ -1,6 +1,6 @@
/*
* http_client Module
* Copyright (C) 2015 Edvina AB, Olle E. Johansson
* Copyright (C) 2015-2016 Edvina AB, Olle E. Johansson
*
* Based on part of the utils module and part
* of the json-rpc-c module
Expand Down Expand Up @@ -60,6 +60,7 @@
#include "../../rpc_lookup.h"
#include "../../config.h"
#include "../../lvalue.h"
#include "../../pt.h" /* Process table */

#include "functions.h"
#include "curlcon.h"
Expand Down Expand Up @@ -167,7 +168,7 @@ static pv_export_t mod_pvs[] = {
{{"curlerror", (sizeof("curlerror")-1)}, /* Curl error codes */
PVT_OTHER, pv_get_curlerror, 0,
pv_parse_curlerror, 0, 0, 0},
{{"curlredirect", (sizeof("redirect")-1)}, /* Curl error codes */
{{"curlredirect", (sizeof("redirect")-1)}, /* Curl last redirect url - not implemented yet */
PVT_OTHER, pv_get_curlredirect, 0,
pv_parse_curlredirect, 0, 0, 0},
{{0, 0}, 0, 0, 0, 0, 0, 0, 0}
Expand Down Expand Up @@ -299,9 +300,12 @@ int curl_support_ipv6()
/* Child initialization function */
static int child_init(int rank)
{
int i = my_pid();

if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN) {
return 0; /* do nothing for the main process */
}
LM_DBG("*** http_client module initializing process %d\n", i);

return 0;
}
Expand Down

0 comments on commit c3c4788

Please sign in to comment.