Browse code

http_client Add debug and some notes in TODO

Olle E. Johansson authored on 30/03/2016 20:00:29
Showing 2 changed files
... ...
@@ -13,6 +13,9 @@ The http_client module - todo
13 13
 - save fingerprint of cert for trust-on-first-use procedure
14 14
 
15 15
 - connection and last status for httpcon-object, needs to be object in process memory, so child_init
16
+	Note: Right now httpcon-objects are allocated in pkg memory. This is bad for a reload,
17
+	but good for what we need to do here. 
18
+	- test what happens if we allocate curlcon objects in shared memory and use locks
16 19
 	- if 5xx response or timeout set flag
17 20
 	- function in dialplan - httpcon_exists(object)
18 21
 	- pv $curlstatus(object) ??
... ...
@@ -1,6 +1,6 @@
1 1
 /*
2 2
  * http_client Module
3
- * Copyright (C) 2015 Edvina AB, Olle E. Johansson
3
+ * Copyright (C) 2015-2016 Edvina AB, Olle E. Johansson
4 4
  *
5 5
  * Based on part of the utils module and part
6 6
  * of the json-rpc-c module
... ...
@@ -60,6 +60,7 @@
60 60
 #include "../../rpc_lookup.h"
61 61
 #include "../../config.h"
62 62
 #include "../../lvalue.h"
63
+#include "../../pt.h"		/* Process table */
63 64
 
64 65
 #include "functions.h"
65 66
 #include "curlcon.h"
... ...
@@ -167,7 +168,7 @@ static pv_export_t mod_pvs[] = {
167 168
     {{"curlerror", (sizeof("curlerror")-1)}, /* Curl error codes */
168 169
      PVT_OTHER, pv_get_curlerror, 0,
169 170
 	pv_parse_curlerror, 0, 0, 0},
170
-    {{"curlredirect", (sizeof("redirect")-1)}, /* Curl error codes */
171
+    {{"curlredirect", (sizeof("redirect")-1)}, /* Curl last redirect url - not implemented yet */
171 172
      PVT_OTHER, pv_get_curlredirect, 0,
172 173
 	pv_parse_curlredirect, 0, 0, 0},
173 174
     {{0, 0}, 0, 0, 0, 0, 0, 0, 0}
... ...
@@ -299,9 +300,12 @@ int curl_support_ipv6()
299 300
 /* Child initialization function */
300 301
 static int child_init(int rank)
301 302
 {	
303
+	int i = my_pid();
304
+
302 305
 	if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN) {
303 306
 		return 0; /* do nothing for the main process */
304 307
 	}
308
+	LM_DBG("*** http_client module initializing process %d\n", i);
305 309
 
306 310
     	return 0;
307 311
 }