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");
... ...
@@ -385,7 +385,6 @@ void set_curl_mem_callbacks(void)
385 385
 			LM_ERR ("invalid memory manager: %d\n", curl_memory_manager);
386 386
 			break;
387 387
 	}
388
-
389 388
 }
390 389
 
391 390
 int init_http_multi(struct event_base *evbase, struct http_m_global *wg)
... ...
@@ -393,7 +392,6 @@ int init_http_multi(struct event_base *evbase, struct http_m_global *wg)
393 392
 	g = wg;
394 393
 	g->evbase = evbase;
395 394
 
396
-	set_curl_mem_callbacks();
397 395
 
398 396
 	g->multi = curl_multi_init();
399 397
 	LM_DBG("curl_multi %p initialized on global %p (evbase %p)\n", g->multi, g, evbase);