Skip to content

Commit

Permalink
http_async_client: libssl refactor thread executors for curl
Browse files Browse the repository at this point in the history
  • Loading branch information
space88man committed Feb 27, 2024
1 parent f5164b3 commit 6a0c86b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/modules/http_async_client/http_async_client_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 1 addition & 5 deletions src/modules/http_async_client/http_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 6a0c86b

Please sign in to comment.