Module: kamailio
Branch: master
Commit: 6a0c86bba8ff1200b8fe9197f2a76688a9948808
URL:
https://github.com/kamailio/kamailio/commit/6a0c86bba8ff1200b8fe9197f2a7668…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-02-27T12:38:09+08:00
http_async_client: libssl refactor thread executors for curl
---
Modified: src/modules/http_async_client/http_async_client_mod.c
Modified: src/modules/http_async_client/http_multi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6a0c86bba8ff1200b8fe9197f2a7668…
Patch:
https://github.com/kamailio/kamailio/commit/6a0c86bba8ff1200b8fe9197f2a7668…
---
diff --git a/src/modules/http_async_client/http_async_client_mod.c
b/src/modules/http_async_client/http_async_client_mod.c
index 983a9e387f1..97a5c5dd420 100644
--- a/src/modules/http_async_client/http_async_client_mod.c
+++ b/src/modules/http_async_client/http_async_client_mod.c
@@ -50,6 +50,9 @@
#include "../../core/cfg/cfg_struct.h"
#include "../../core/fmsg.h"
#include "../../core/kemi.h"
+#define KSR_RTHREAD_NEED_V
+#define KSR_RTHREAD_SKIP_P
+#include "../../core/rthreads.h"
#include "../../modules/tm/tm_load.h"
#include "../../modules/pv/pv_api.h"
@@ -285,7 +288,7 @@ static int mod_init(void)
return -1;
}
- set_curl_mem_callbacks();
+ run_threadV((_thread_protoV)&set_curl_mem_callbacks);
/* init faked sip msg */
if(faked_msg_init() < 0) {
diff --git a/src/modules/http_async_client/http_multi.c
b/src/modules/http_async_client/http_multi.c
index a0ee1c877cf..a57aba9c951 100644
--- a/src/modules/http_async_client/http_multi.c
+++ b/src/modules/http_async_client/http_multi.c
@@ -32,9 +32,6 @@
#include "../../core/mem/mem.h"
#include "../../core/ut.h"
#include "../../core/hashes.h"
-#define KSR_RTHREAD_NEED_4L
-#define KSR_RTHREAD_SKIP_P
-#include "../../core/rthreads.h"
#include "http_multi.h"
extern int hash_size;
@@ -392,8 +389,7 @@ void set_curl_mem_callbacks(void)
break;
case 1:
LM_DBG("Initilizing cURL with sys malloc\n");
- rc = run_thread4L(
- (_thread_proto4L)curl_global_init, CURL_GLOBAL_ALL);
+ rc = curl_global_init(CURL_GLOBAL_ALL);
if(rc != 0) {
LM_ERR("Cannot initialize cURL: %d\n", rc);
}