Module: kamailio
Branch: 5.8
Commit: 5d4fae5c24eb4f13d585e1af4cb1753ea5a784c5
URL:
https://github.com/kamailio/kamailio/commit/5d4fae5c24eb4f13d585e1af4cb1753…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-02-27T05:05:20+08:00
http_async_client: libssl thread executor for curl_global_init()
Cherry-pick from 514635dc3e
---
Modified: src/modules/http_async_client/http_multi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5d4fae5c24eb4f13d585e1af4cb1753…
Patch:
https://github.com/kamailio/kamailio/commit/5d4fae5c24eb4f13d585e1af4cb1753…
---
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);
}