Browse code

httpa_asyc_client: set curl memory callbacks in module initialization

Federico Cabiddu authored on 08/09/2020 13:04:04
Showing 2 changed files
... ...
@@ -275,6 +275,8 @@ static int mod_init(void)
275 275
 		return -1;
276 276
 	}
277 277
 
278
+	set_curl_mem_callbacks();
279
+
278 280
 	/* init faked sip msg */
279 281
 	if(faked_msg_init()<0) {
280 282
 		LM_ERR("failed to init faked sip msg\n");
... ...
@@ -392,7 +392,6 @@ void set_curl_mem_callbacks(void)
392 392
 			LM_ERR ("invalid memory manager: %d\n", curl_memory_manager);
393 393
 			break;
394 394
 	}
395
-
396 395
 }
397 396
 
398 397
 int init_http_multi(struct event_base *evbase, struct http_m_global *wg)
... ...
@@ -400,7 +399,6 @@ int init_http_multi(struct event_base *evbase, struct http_m_global *wg)
400 399
 	g = wg;
401 400
 	g->evbase = evbase;
402 401
 
403
-	set_curl_mem_callbacks();
404 402
 
405 403
 	g->multi = curl_multi_init();
406 404
 	LM_DBG("curl_multi %p initialized on global %p (evbase %p)\n", g->multi, g, evbase);