Module: kamailio
Branch: master
Commit: 514635dc3e6182ff0daaebe548ed613edc2de61f
URL: 
https://github.com/kamailio/kamailio/commit/514635dc3e6182ff0daaebe548ed613edc2de61f

Author: S-P Chan <shihping.c...@gmail.com>
Committer: S-P Chan <shihping.c...@gmail.com>
Date: 2024-02-27T05:01:14+08:00

http_async_client: libssl thread executor for curl_global_init()

---

Modified: src/modules/http_async_client/http_multi.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/514635dc3e6182ff0daaebe548ed613edc2de61f.diff
Patch: 
https://github.com/kamailio/kamailio/commit/514635dc3e6182ff0daaebe548ed613edc2de61f.patch

---

diff --git a/src/modules/http_async_client/http_multi.c 
b/src/modules/http_async_client/http_multi.c
index a57aba9c951..a0ee1c877cf 100644
--- a/src/modules/http_async_client/http_multi.c
+++ b/src/modules/http_async_client/http_multi.c
@@ -32,6 +32,9 @@
 #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;
@@ -389,7 +392,8 @@ void set_curl_mem_callbacks(void)
                        break;
                case 1:
                        LM_DBG("Initilizing cURL with sys malloc\n");
-                       rc = curl_global_init(CURL_GLOBAL_ALL);
+                       rc = run_thread4L(
+                                       (_thread_proto4L)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