Module: kamailio
Branch: 5.8
Commit: bc4c206999094ed74e77c73f5537e857111d0a30
URL: 
https://github.com/kamailio/kamailio/commit/bc4c206999094ed74e77c73f5537e857111d0a30

Author: S-P Chan <shihping.c...@gmail.com>
Committer: S-P Chan <shihping.c...@gmail.com>
Date: 2024-02-27T12:39:52+08:00

http_async_client: libssl refactor thread executors for curl

Cherry-pick from 6a0c86bba8

---

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/bc4c206999094ed74e77c73f5537e857111d0a30.diff
Patch: 
https://github.com/kamailio/kamailio/commit/bc4c206999094ed74e77c73f5537e857111d0a30.patch

---

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);
                        }

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to