[sr-dev] git:master:59230a07: tcpops: variables to get active connection attributes
Module: kamailio Branch: master Commit: 59230a07b8c6a79c4a574890bae775c3d166c471 URL: https://github.com/kamailio/kamailio/commit/59230a07b8c6a79c4a574890bae775c3d166c471 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2024-02-27T07:58:14+01:00 tcpops: variables to get active connection attributes --- Modified: src/modules/tcpops/tcpops_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/59230a07b8c6a79c4a574890bae775c3d166c471.diff Patch: https://github.com/kamailio/kamailio/commit/59230a07b8c6a79c4a574890bae775c3d166c471.patch --- diff --git a/src/modules/tcpops/tcpops_mod.c b/src/modules/tcpops/tcpops_mod.c index d8953c4345f..15e39993d64 100644 --- a/src/modules/tcpops/tcpops_mod.c +++ b/src/modules/tcpops/tcpops_mod.c @@ -762,24 +762,42 @@ static int pv_get_tcp(sip_msg_t *msg, pv_param_t *param, pv_value_t *res) return -1; } - if((con = tcpconn_get(msg->rcv.proto_reserved1, 0, 0, 0, 0)) == NULL) { - return pv_get_null(msg, param, res); - } switch(param->pvn.u.isname.name.n) { case 1: + sval.s = ip_addr2a(&msg->rcv.src_ip); + sval.len = strlen(sval.s); + return pv_get_strval(msg, param, res, &sval); + case 2: + ival = msg->rcv.src_port; + return pv_get_sintval(msg, param, res, ival); + case 3: + if((con = tcpconn_get(msg->rcv.proto_reserved1, 0, 0, 0, 0)) + == NULL) { + return pv_get_null(msg, param, res); + } sval.s = ip_addr2a(&con->cinfo.src_ip); tcpconn_put(con); sval.len = strlen(sval.s); return pv_get_strval(msg, param, res, &sval); - case 2: + case 4: + if((con = tcpconn_get(msg->rcv.proto_reserved1, 0, 0, 0, 0)) + == NULL) { + return pv_get_null(msg, param, res); + } ival = con->cinfo.src_port; tcpconn_put(con); return pv_get_sintval(msg, param, res, ival); - default: + case 5: + if((con = tcpconn_get(msg->rcv.proto_reserved1, 0, 0, 0, 0)) + == NULL) { + return pv_get_null(msg, param, res); + } ival = con->id; tcpconn_put(con); return pv_get_sintval(msg, param, res, ival); + default: + return pv_get_sintval(msg, param, res, msg->rcv.proto_reserved1); } } @@ -805,6 +823,17 @@ static int pv_parse_tcp_name(pv_spec_p sp, str *in) case 5: if(strncmp(in->s, "conid", 5) == 0) { sp->pvp.pvn.u.isname.name.n = 0; + } else if(strncmp(in->s, "ac_si", 5) == 0) { + sp->pvp.pvn.u.isname.name.n = 3; + } else if(strncmp(in->s, "ac_sp", 5) == 0) { + sp->pvp.pvn.u.isname.name.n = 4; + } else { + goto error; + } + break; + case 6: + if(strncmp(in->s, "aconid", 6) == 0) { + sp->pvp.pvn.u.isname.name.n = 5; } else { goto error; } ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:5.7:1d9ea67e: http_async_client: libssl refactor thread executors for curl
Module: kamailio Branch: 5.7 Commit: 1d9ea67eb29b4fd45c00a00581e7b73a9b42c8ce URL: https://github.com/kamailio/kamailio/commit/1d9ea67eb29b4fd45c00a00581e7b73a9b42c8ce Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T12:40:11+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/1d9ea67eb29b4fd45c00a00581e7b73a9b42c8ce.diff Patch: https://github.com/kamailio/kamailio/commit/1d9ea67eb29b4fd45c00a00581e7b73a9b42c8ce.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 e9f6cb0d26b..4b984d3efdc 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
[sr-dev] git:5.8:bc4c2069: http_async_client: libssl refactor thread executors for curl
Module: kamailio Branch: 5.8 Commit: bc4c206999094ed74e77c73f5537e857111d0a30 URL: https://github.com/kamailio/kamailio/commit/bc4c206999094ed74e77c73f5537e857111d0a30 Author: S-P Chan Committer: S-P Chan 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
[sr-dev] git:master:6a0c86bb: http_async_client: libssl refactor thread executors for curl
Module: kamailio Branch: master Commit: 6a0c86bba8ff1200b8fe9197f2a76688a9948808 URL: https://github.com/kamailio/kamailio/commit/6a0c86bba8ff1200b8fe9197f2a76688a9948808 Author: S-P Chan Committer: S-P Chan 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/6a0c86bba8ff1200b8fe9197f2a76688a9948808.diff Patch: https://github.com/kamailio/kamailio/commit/6a0c86bba8ff1200b8fe9197f2a76688a9948808.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
[sr-dev] Re: [kamailio/kamailio] t_uac_send parser does not like exclamation or other non alphabetic characters in Contact header (Issue #3682)
This issue is stale because it has been open 6 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3682#issuecomment-1965681669 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Kamailio 5.6 (and 5.7) core dumps with uac_req_send() from uac module (Issue #3725)
There are dbgsym packages available in the repo -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3725#issuecomment-1965516681 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:5.7:8098136c: xcap_client: libssl thread executor for curl_global_init()
Module: kamailio Branch: 5.7 Commit: 8098136ccbe2050b499d3d962c44d58203afc370 URL: https://github.com/kamailio/kamailio/commit/8098136ccbe2050b499d3d962c44d58203afc370 Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:11:36+08:00 xcap_client: libssl thread executor for curl_global_init() Cherry-pick from f5164b39c8 --- Modified: src/modules/xcap_client/xcap_client.c --- Diff: https://github.com/kamailio/kamailio/commit/8098136ccbe2050b499d3d962c44d58203afc370.diff Patch: https://github.com/kamailio/kamailio/commit/8098136ccbe2050b499d3d962c44d58203afc370.patch --- diff --git a/src/modules/xcap_client/xcap_client.c b/src/modules/xcap_client/xcap_client.c index ac77228bfde..4de2d367b63 100644 --- a/src/modules/xcap_client/xcap_client.c +++ b/src/modules/xcap_client/xcap_client.c @@ -41,6 +41,9 @@ #include "../../core/mem/shm_mem.h" #include "../../core/rpc.h" #include "../../core/rpc_lookup.h" +#define KSR_RTHREAD_NEED_4L +#define KSR_RTHREAD_SKIP_P +#include "../../core/rthreads.h" #include "../presence/utils_func.h" #include "xcap_functions.h" #include "xcap_client.h" @@ -140,7 +143,7 @@ static int mod_init(void) xcap_dbf.close(xcap_db); xcap_db = NULL; - curl_global_init(CURL_GLOBAL_ALL); + run_thread4L((_thread_proto4L)curl_global_init, CURL_GLOBAL_ALL); if(periodical_query) { register_timer(query_xcap_update, 0, query_period); ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:5.7:d9285fc7: http_client: libssl thread executor for curl_global_init()
Module: kamailio Branch: 5.7 Commit: d9285fc741c2a3c3995e037c23393df108e94bf1 URL: https://github.com/kamailio/kamailio/commit/d9285fc741c2a3c3995e037c23393df108e94bf1 Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:11:33+08:00 http_client: libssl thread executor for curl_global_init() Cherry-pick from f58225950c --- Modified: src/modules/http_client/http_client.c --- Diff: https://github.com/kamailio/kamailio/commit/d9285fc741c2a3c3995e037c23393df108e94bf1.diff Patch: https://github.com/kamailio/kamailio/commit/d9285fc741c2a3c3995e037c23393df108e94bf1.patch --- diff --git a/src/modules/http_client/http_client.c b/src/modules/http_client/http_client.c index 430933e23d2..3cf662820f5 100644 --- a/src/modules/http_client/http_client.c +++ b/src/modules/http_client/http_client.c @@ -64,6 +64,9 @@ #include "../../core/lvalue.h" #include "../../core/pt.h" /* Process table */ #include "../../core/kemi.h" +#define KSR_RTHREAD_NEED_4L +#define KSR_RTHREAD_SKIP_P +#include "../../core/rthreads.h" #include "functions.h" #include "curlcon.h" @@ -278,7 +281,7 @@ static int mod_init(void) LM_DBG("init curl module\n"); /* Initialize curl */ - if(curl_global_init(CURL_GLOBAL_ALL)) { + if(run_thread4L((_thread_proto4L)&curl_global_init, CURL_GLOBAL_ALL)) { LM_ERR("curl_global_init failed\n"); return -1; } ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:5.7:d01b6e22: http_async_client: libssl thread executor for curl_global_init()
Module: kamailio Branch: 5.7 Commit: d01b6e22e083c6fab457f8fbe1c8ac2526a37d30 URL: https://github.com/kamailio/kamailio/commit/d01b6e22e083c6fab457f8fbe1c8ac2526a37d30 Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:11:23+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/d01b6e22e083c6fab457f8fbe1c8ac2526a37d30.diff Patch: https://github.com/kamailio/kamailio/commit/d01b6e22e083c6fab457f8fbe1c8ac2526a37d30.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
[sr-dev] git:5.7:f850f4ee: Revert ed9d7bc58b - split into per module commits
Module: kamailio Branch: 5.7 Commit: f850f4eef66b6461bb93ede9bf67b52458e18856 URL: https://github.com/kamailio/kamailio/commit/f850f4eef66b6461bb93ede9bf67b52458e18856 Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:07:27+08:00 Revert ed9d7bc58b - split into per module commits --- Modified: src/core/rthreads.h Modified: src/modules/http_async_client/http_multi.c Modified: src/modules/http_client/http_client.c Modified: src/modules/xcap_client/xcap_client.c --- Diff: https://github.com/kamailio/kamailio/commit/f850f4eef66b6461bb93ede9bf67b52458e18856.diff Patch: https://github.com/kamailio/kamailio/commit/f850f4eef66b6461bb93ede9bf67b52458e18856.patch --- diff --git a/src/core/rthreads.h b/src/core/rthreads.h index 0f4f0cf8b8a..e96f45c9395 100644 --- a/src/core/rthreads.h +++ b/src/core/rthreads.h @@ -254,41 +254,3 @@ static int run_thread4P5I2P2(_thread_proto4P5I2P2 fn, void *arg1, void *arg2, #endif } #endif - -/* - * prototype: CURLcode curl_global_init(long flags) { ... } - */ -#ifdef KSR_RTHREAD_NEED_4L -typedef int (*_thread_proto4L)(long); -struct _thread_args4L -{ - _thread_proto4L fn; - long arg1; - int *ret; -}; -static void *run_thread_wrap4L(struct _thread_args4L *args) -{ - *args->ret = (*args->fn)(args->arg1); - return NULL; -} - -static int run_thread4L(_thread_proto4L fn, long arg1) -{ -#ifdef USE_TLS - pthread_t tid; - int ret; - - if(likely(ksr_tls_threads_mode == 0 - || (ksr_tls_threads_mode == 1 && process_no > 0))) { - return fn(arg1); - } - pthread_create(&tid, NULL, (_thread_proto)run_thread_wrap4L, - &(struct _thread_args4L){fn, arg1, &ret}); - pthread_join(tid, NULL); - - return ret; -#else - return fn(arg1) -#endif -} -#endif 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); } diff --git a/src/modules/http_client/http_client.c b/src/modules/http_client/http_client.c index 3cf662820f5..430933e23d2 100644 --- a/src/modules/http_client/http_client.c +++ b/src/modules/http_client/http_client.c @@ -64,9 +64,6 @@ #include "../../core/lvalue.h" #include "../../core/pt.h" /* Process table */ #include "../../core/kemi.h" -#define KSR_RTHREAD_NEED_4L -#define KSR_RTHREAD_SKIP_P -#include "../../core/rthreads.h" #include "functions.h" #include "curlcon.h" @@ -281,7 +278,7 @@ static int mod_init(void) LM_DBG("init curl module\n"); /* Initialize curl */ - if(run_thread4L((_thread_proto4L)&curl_global_init, CURL_GLOBAL_ALL)) { + if(curl_global_init(CURL_GLOBAL_ALL)) { LM_ERR("curl_global_init failed\n"); return -1; } diff --git a/src/modules/xcap_client/xcap_client.c b/src/modules/xcap_client/xcap_client.c index 4de2d367b63..ac77228bfde 100644 --- a/src/modules/xcap_client/xcap_client.c +++ b/src/modules/xcap_client/xcap_client.c @@ -41,9 +41,6 @@ #include "../../core/mem/shm_mem.h" #include "../../core/rpc.h" #include "../../core/rpc_lookup.h" -#define KSR_RTHREAD_NEED_4L -#define KSR_RTHREAD_SKIP_P -#include "../../core/rthreads.h" #include "../presence/utils_func.h" #include "xcap_functions.h" #include "xcap_client.h" @@ -143,7 +140,7 @@ static int mod_init(void) xcap_dbf.close(xcap_db); xcap_db = NULL; - run_thread4L((_thread_proto4L)curl_global_init, CURL_GLOBAL_ALL); + curl_global_init(CURL_GLOBAL_ALL); if(periodical_query) { register_timer(query_xcap_update, 0, query_period); ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:5.7:0f1d78a2: core/rthreads.h: add thread executor for curl_global_init()
Module: kamailio Branch: 5.7 Commit: 0f1d78a22aeefef7601d0cf646ec154f5e52c175 URL: https://github.com/kamailio/kamailio/commit/0f1d78a22aeefef7601d0cf646ec154f5e52c175 Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:11:08+08:00 core/rthreads.h: add thread executor for curl_global_init() Cherry-pick from db05449932 --- Modified: src/core/rthreads.h --- Diff: https://github.com/kamailio/kamailio/commit/0f1d78a22aeefef7601d0cf646ec154f5e52c175.diff Patch: https://github.com/kamailio/kamailio/commit/0f1d78a22aeefef7601d0cf646ec154f5e52c175.patch --- diff --git a/src/core/rthreads.h b/src/core/rthreads.h index e96f45c9395..0f4f0cf8b8a 100644 --- a/src/core/rthreads.h +++ b/src/core/rthreads.h @@ -254,3 +254,41 @@ static int run_thread4P5I2P2(_thread_proto4P5I2P2 fn, void *arg1, void *arg2, #endif } #endif + +/* + * prototype: CURLcode curl_global_init(long flags) { ... } + */ +#ifdef KSR_RTHREAD_NEED_4L +typedef int (*_thread_proto4L)(long); +struct _thread_args4L +{ + _thread_proto4L fn; + long arg1; + int *ret; +}; +static void *run_thread_wrap4L(struct _thread_args4L *args) +{ + *args->ret = (*args->fn)(args->arg1); + return NULL; +} + +static int run_thread4L(_thread_proto4L fn, long arg1) +{ +#ifdef USE_TLS + pthread_t tid; + int ret; + + if(likely(ksr_tls_threads_mode == 0 + || (ksr_tls_threads_mode == 1 && process_no > 0))) { + return fn(arg1); + } + pthread_create(&tid, NULL, (_thread_proto)run_thread_wrap4L, + &(struct _thread_args4L){fn, arg1, &ret}); + pthread_join(tid, NULL); + + return ret; +#else + return fn(arg1) +#endif +} +#endif ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:5.8:49c3290f: http_client: libssl thread executor for curl_global_init()
Module: kamailio Branch: 5.8 Commit: 49c3290fc6eb50de0b08661c50ff42663ff3de6b URL: https://github.com/kamailio/kamailio/commit/49c3290fc6eb50de0b08661c50ff42663ff3de6b Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:05:40+08:00 http_client: libssl thread executor for curl_global_init() Cherry-pick from f58225950c --- Modified: src/modules/http_client/http_client.c --- Diff: https://github.com/kamailio/kamailio/commit/49c3290fc6eb50de0b08661c50ff42663ff3de6b.diff Patch: https://github.com/kamailio/kamailio/commit/49c3290fc6eb50de0b08661c50ff42663ff3de6b.patch --- diff --git a/src/modules/http_client/http_client.c b/src/modules/http_client/http_client.c index 48844246984..ca605ec1729 100644 --- a/src/modules/http_client/http_client.c +++ b/src/modules/http_client/http_client.c @@ -64,6 +64,9 @@ #include "../../core/lvalue.h" #include "../../core/pt.h" /* Process table */ #include "../../core/kemi.h" +#define KSR_RTHREAD_NEED_4L +#define KSR_RTHREAD_SKIP_P +#include "../../core/rthreads.h" #include "functions.h" #include "curlcon.h" @@ -76,8 +79,10 @@ MODULE_VERSION #define CURL_USER_AGENT_LEN (sizeof(CURL_USER_AGENT) - 1) /* Module parameter variables */ -unsigned int default_connection_timeout = 0; /*!< 0 = not user configured - the default (4 seconds) will be used */ -unsigned int timeout_mode = 1; /*!< 0 = timeout disabled, 1 (default) = timeout in seconds, 2 = timeout in ms */ +unsigned int default_connection_timeout = + 0; /*!< 0 = not user configured - the default (4 seconds) will be used */ +unsigned int timeout_mode = + 1; /*!< 0 = timeout disabled, 1 (default) = timeout in seconds, 2 = timeout in ms */ char *default_tls_cacert = NULL; /*!< File name: Default CA cert to use for curl TLS connection */ str default_tls_clientcert = @@ -280,7 +285,7 @@ static int mod_init(void) LM_DBG("init curl module\n"); /* Initialize curl */ - if(curl_global_init(CURL_GLOBAL_ALL)) { + if(run_thread4L((_thread_proto4L)&curl_global_init, CURL_GLOBAL_ALL)) { LM_ERR("curl_global_init failed\n"); return -1; } @@ -317,16 +322,16 @@ static int mod_init(void) * - 1 (default) : timeout value is in seconds. * - 2 : timeout value is in milliseconds. */ - if (!(timeout_mode == 1 || timeout_mode == 2)) { - if (default_connection_timeout > 0) { + if(!(timeout_mode == 1 || timeout_mode == 2)) { + if(default_connection_timeout > 0) { LM_WARN("configured connection_timeout is ignored " - "because timeouts are disabled (timeout_mode)\n"); + "because timeouts are disabled (timeout_mode)\n"); } - } else if (default_connection_timeout == 0) { + } else if(default_connection_timeout == 0) { LM_INFO("curl connection timeout set to zero. Using default 4 secs\n"); - if (timeout_mode == 1) { /* timeout is in seconds (default) */ + if(timeout_mode == 1) { /* timeout is in seconds (default) */ default_connection_timeout = 4; - } else if (timeout_mode == 2) { /* timeout is in milliseconds */ + } else if(timeout_mode == 2) { /* timeout is in milliseconds */ default_connection_timeout = 4000; } } ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:5.8:ce17fee3: core/rthreads.h: add thread executor for curl_global_init()
Module: kamailio Branch: 5.8 Commit: ce17fee304e9ffa5046194a0827f771742113640 URL: https://github.com/kamailio/kamailio/commit/ce17fee304e9ffa5046194a0827f771742113640 Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:04:59+08:00 core/rthreads.h: add thread executor for curl_global_init() Cherry-pick from db05449932 --- Modified: src/core/rthreads.h --- Diff: https://github.com/kamailio/kamailio/commit/ce17fee304e9ffa5046194a0827f771742113640.diff Patch: https://github.com/kamailio/kamailio/commit/ce17fee304e9ffa5046194a0827f771742113640.patch --- diff --git a/src/core/rthreads.h b/src/core/rthreads.h index e96f45c9395..0f4f0cf8b8a 100644 --- a/src/core/rthreads.h +++ b/src/core/rthreads.h @@ -254,3 +254,41 @@ static int run_thread4P5I2P2(_thread_proto4P5I2P2 fn, void *arg1, void *arg2, #endif } #endif + +/* + * prototype: CURLcode curl_global_init(long flags) { ... } + */ +#ifdef KSR_RTHREAD_NEED_4L +typedef int (*_thread_proto4L)(long); +struct _thread_args4L +{ + _thread_proto4L fn; + long arg1; + int *ret; +}; +static void *run_thread_wrap4L(struct _thread_args4L *args) +{ + *args->ret = (*args->fn)(args->arg1); + return NULL; +} + +static int run_thread4L(_thread_proto4L fn, long arg1) +{ +#ifdef USE_TLS + pthread_t tid; + int ret; + + if(likely(ksr_tls_threads_mode == 0 + || (ksr_tls_threads_mode == 1 && process_no > 0))) { + return fn(arg1); + } + pthread_create(&tid, NULL, (_thread_proto)run_thread_wrap4L, + &(struct _thread_args4L){fn, arg1, &ret}); + pthread_join(tid, NULL); + + return ret; +#else + return fn(arg1) +#endif +} +#endif ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:5.8:53398940: xcap_client: libssl thread executor for curl_global_init()
Module: kamailio Branch: 5.8 Commit: 533989406d0fa1e57ff007fd8d7f702f5831dacd URL: https://github.com/kamailio/kamailio/commit/533989406d0fa1e57ff007fd8d7f702f5831dacd Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:05:54+08:00 xcap_client: libssl thread executor for curl_global_init() Cherry-pick from f5164b39c8 --- Modified: src/modules/xcap_client/xcap_client.c --- Diff: https://github.com/kamailio/kamailio/commit/533989406d0fa1e57ff007fd8d7f702f5831dacd.diff Patch: https://github.com/kamailio/kamailio/commit/533989406d0fa1e57ff007fd8d7f702f5831dacd.patch --- diff --git a/src/modules/xcap_client/xcap_client.c b/src/modules/xcap_client/xcap_client.c index ac77228bfde..4de2d367b63 100644 --- a/src/modules/xcap_client/xcap_client.c +++ b/src/modules/xcap_client/xcap_client.c @@ -41,6 +41,9 @@ #include "../../core/mem/shm_mem.h" #include "../../core/rpc.h" #include "../../core/rpc_lookup.h" +#define KSR_RTHREAD_NEED_4L +#define KSR_RTHREAD_SKIP_P +#include "../../core/rthreads.h" #include "../presence/utils_func.h" #include "xcap_functions.h" #include "xcap_client.h" @@ -140,7 +143,7 @@ static int mod_init(void) xcap_dbf.close(xcap_db); xcap_db = NULL; - curl_global_init(CURL_GLOBAL_ALL); + run_thread4L((_thread_proto4L)curl_global_init, CURL_GLOBAL_ALL); if(periodical_query) { register_timer(query_xcap_update, 0, query_period); ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:5.8:5d4fae5c: http_async_client: libssl thread executor for curl_global_init()
Module: kamailio Branch: 5.8 Commit: 5d4fae5c24eb4f13d585e1af4cb1753ea5a784c5 URL: https://github.com/kamailio/kamailio/commit/5d4fae5c24eb4f13d585e1af4cb1753ea5a784c5 Author: S-P Chan Committer: S-P Chan 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/5d4fae5c24eb4f13d585e1af4cb1753ea5a784c5.diff Patch: https://github.com/kamailio/kamailio/commit/5d4fae5c24eb4f13d585e1af4cb1753ea5a784c5.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
[sr-dev] git:5.8:b1a30880: Revert ac4f1be039 - split into per module commits
Module: kamailio Branch: 5.8 Commit: b1a308801430a5561c4c13c1d4602fe5d5542cf8 URL: https://github.com/kamailio/kamailio/commit/b1a308801430a5561c4c13c1d4602fe5d5542cf8 Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:03:10+08:00 Revert ac4f1be039 - split into per module commits --- Modified: src/core/rthreads.h Modified: src/modules/http_async_client/http_multi.c Modified: src/modules/http_client/http_client.c Modified: src/modules/xcap_client/xcap_client.c --- Diff: https://github.com/kamailio/kamailio/commit/b1a308801430a5561c4c13c1d4602fe5d5542cf8.diff Patch: https://github.com/kamailio/kamailio/commit/b1a308801430a5561c4c13c1d4602fe5d5542cf8.patch ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:master:514635dc: http_async_client: libssl thread executor for curl_global_init()
Module: kamailio Branch: master Commit: 514635dc3e6182ff0daaebe548ed613edc2de61f URL: https://github.com/kamailio/kamailio/commit/514635dc3e6182ff0daaebe548ed613edc2de61f Author: S-P Chan Committer: S-P Chan 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
[sr-dev] git:master:db054499: core/rthreads.h: add thread executor for curl_global_init()
Module: kamailio Branch: master Commit: db05449932b1753d4b705f88445533bbe1ed6475 URL: https://github.com/kamailio/kamailio/commit/db05449932b1753d4b705f88445533bbe1ed6475 Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:00:35+08:00 core/rthreads.h: add thread executor for curl_global_init() --- Modified: src/core/rthreads.h --- Diff: https://github.com/kamailio/kamailio/commit/db05449932b1753d4b705f88445533bbe1ed6475.diff Patch: https://github.com/kamailio/kamailio/commit/db05449932b1753d4b705f88445533bbe1ed6475.patch --- diff --git a/src/core/rthreads.h b/src/core/rthreads.h index e96f45c9395..0f4f0cf8b8a 100644 --- a/src/core/rthreads.h +++ b/src/core/rthreads.h @@ -254,3 +254,41 @@ static int run_thread4P5I2P2(_thread_proto4P5I2P2 fn, void *arg1, void *arg2, #endif } #endif + +/* + * prototype: CURLcode curl_global_init(long flags) { ... } + */ +#ifdef KSR_RTHREAD_NEED_4L +typedef int (*_thread_proto4L)(long); +struct _thread_args4L +{ + _thread_proto4L fn; + long arg1; + int *ret; +}; +static void *run_thread_wrap4L(struct _thread_args4L *args) +{ + *args->ret = (*args->fn)(args->arg1); + return NULL; +} + +static int run_thread4L(_thread_proto4L fn, long arg1) +{ +#ifdef USE_TLS + pthread_t tid; + int ret; + + if(likely(ksr_tls_threads_mode == 0 + || (ksr_tls_threads_mode == 1 && process_no > 0))) { + return fn(arg1); + } + pthread_create(&tid, NULL, (_thread_proto)run_thread_wrap4L, + &(struct _thread_args4L){fn, arg1, &ret}); + pthread_join(tid, NULL); + + return ret; +#else + return fn(arg1) +#endif +} +#endif ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:master:f5822595: http_client: libssl thread executor for curl_global_init()
Module: kamailio Branch: master Commit: f58225950cc2bfa63a230a3bc8460bbcbfa7738e URL: https://github.com/kamailio/kamailio/commit/f58225950cc2bfa63a230a3bc8460bbcbfa7738e Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:01:31+08:00 http_client: libssl thread executor for curl_global_init() --- Modified: src/modules/http_client/http_client.c --- Diff: https://github.com/kamailio/kamailio/commit/f58225950cc2bfa63a230a3bc8460bbcbfa7738e.diff Patch: https://github.com/kamailio/kamailio/commit/f58225950cc2bfa63a230a3bc8460bbcbfa7738e.patch --- diff --git a/src/modules/http_client/http_client.c b/src/modules/http_client/http_client.c index 48844246984..ca605ec1729 100644 --- a/src/modules/http_client/http_client.c +++ b/src/modules/http_client/http_client.c @@ -64,6 +64,9 @@ #include "../../core/lvalue.h" #include "../../core/pt.h" /* Process table */ #include "../../core/kemi.h" +#define KSR_RTHREAD_NEED_4L +#define KSR_RTHREAD_SKIP_P +#include "../../core/rthreads.h" #include "functions.h" #include "curlcon.h" @@ -76,8 +79,10 @@ MODULE_VERSION #define CURL_USER_AGENT_LEN (sizeof(CURL_USER_AGENT) - 1) /* Module parameter variables */ -unsigned int default_connection_timeout = 0; /*!< 0 = not user configured - the default (4 seconds) will be used */ -unsigned int timeout_mode = 1; /*!< 0 = timeout disabled, 1 (default) = timeout in seconds, 2 = timeout in ms */ +unsigned int default_connection_timeout = + 0; /*!< 0 = not user configured - the default (4 seconds) will be used */ +unsigned int timeout_mode = + 1; /*!< 0 = timeout disabled, 1 (default) = timeout in seconds, 2 = timeout in ms */ char *default_tls_cacert = NULL; /*!< File name: Default CA cert to use for curl TLS connection */ str default_tls_clientcert = @@ -280,7 +285,7 @@ static int mod_init(void) LM_DBG("init curl module\n"); /* Initialize curl */ - if(curl_global_init(CURL_GLOBAL_ALL)) { + if(run_thread4L((_thread_proto4L)&curl_global_init, CURL_GLOBAL_ALL)) { LM_ERR("curl_global_init failed\n"); return -1; } @@ -317,16 +322,16 @@ static int mod_init(void) * - 1 (default) : timeout value is in seconds. * - 2 : timeout value is in milliseconds. */ - if (!(timeout_mode == 1 || timeout_mode == 2)) { - if (default_connection_timeout > 0) { + if(!(timeout_mode == 1 || timeout_mode == 2)) { + if(default_connection_timeout > 0) { LM_WARN("configured connection_timeout is ignored " - "because timeouts are disabled (timeout_mode)\n"); + "because timeouts are disabled (timeout_mode)\n"); } - } else if (default_connection_timeout == 0) { + } else if(default_connection_timeout == 0) { LM_INFO("curl connection timeout set to zero. Using default 4 secs\n"); - if (timeout_mode == 1) { /* timeout is in seconds (default) */ + if(timeout_mode == 1) { /* timeout is in seconds (default) */ default_connection_timeout = 4; - } else if (timeout_mode == 2) { /* timeout is in milliseconds */ + } else if(timeout_mode == 2) { /* timeout is in milliseconds */ default_connection_timeout = 4000; } } ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:master:f5164b39: xcap_client: libssl thread executor for curl_global_init()
Module: kamailio Branch: master Commit: f5164b39c8b61792e9cf396cfcd0fe3ba567bb86 URL: https://github.com/kamailio/kamailio/commit/f5164b39c8b61792e9cf396cfcd0fe3ba567bb86 Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T05:01:45+08:00 xcap_client: libssl thread executor for curl_global_init() --- Modified: src/modules/xcap_client/xcap_client.c --- Diff: https://github.com/kamailio/kamailio/commit/f5164b39c8b61792e9cf396cfcd0fe3ba567bb86.diff Patch: https://github.com/kamailio/kamailio/commit/f5164b39c8b61792e9cf396cfcd0fe3ba567bb86.patch --- diff --git a/src/modules/xcap_client/xcap_client.c b/src/modules/xcap_client/xcap_client.c index ac77228bfde..4de2d367b63 100644 --- a/src/modules/xcap_client/xcap_client.c +++ b/src/modules/xcap_client/xcap_client.c @@ -41,6 +41,9 @@ #include "../../core/mem/shm_mem.h" #include "../../core/rpc.h" #include "../../core/rpc_lookup.h" +#define KSR_RTHREAD_NEED_4L +#define KSR_RTHREAD_SKIP_P +#include "../../core/rthreads.h" #include "../presence/utils_func.h" #include "xcap_functions.h" #include "xcap_client.h" @@ -140,7 +143,7 @@ static int mod_init(void) xcap_dbf.close(xcap_db); xcap_db = NULL; - curl_global_init(CURL_GLOBAL_ALL); + run_thread4L((_thread_proto4L)curl_global_init, CURL_GLOBAL_ALL); if(periodical_query) { register_timer(query_xcap_update, 0, query_period); ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:master:272a4e08: Revert 8b2573c1f7 - split into per module commits
Module: kamailio Branch: master Commit: 272a4e08be61870cd7788c8cd8dd9be29b50753f URL: https://github.com/kamailio/kamailio/commit/272a4e08be61870cd7788c8cd8dd9be29b50753f Author: S-P Chan Committer: S-P Chan Date: 2024-02-27T04:58:40+08:00 Revert 8b2573c1f7 - split into per module commits --- Modified: src/core/rthreads.h Modified: src/modules/http_async_client/http_multi.c Modified: src/modules/http_client/http_client.c Modified: src/modules/xcap_client/xcap_client.c --- Diff: https://github.com/kamailio/kamailio/commit/272a4e08be61870cd7788c8cd8dd9be29b50753f.diff Patch: https://github.com/kamailio/kamailio/commit/272a4e08be61870cd7788c8cd8dd9be29b50753f.patch ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] ndb_reids module in event_route[tcp:closed] route block error: "no redis context for server" (Issue #3768)
I pushed a commit to git master branch, can you try with it and see if works as expected? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3768#issuecomment-1964108110 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:master:19e5bf3d: ndb_redis: init enabled for tcp-main and postchildinit callbacks
Module: kamailio Branch: master Commit: 19e5bf3d4cfc2b7d47623e307fff7e60e73e8a18 URL: https://github.com/kamailio/kamailio/commit/19e5bf3d4cfc2b7d47623e307fff7e60e73e8a18 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2024-02-26T14:06:38+01:00 ndb_redis: init enabled for tcp-main and postchildinit callbacks - GH #3768 --- Modified: src/modules/ndb_redis/ndb_redis_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/19e5bf3d4cfc2b7d47623e307fff7e60e73e8a18.diff Patch: https://github.com/kamailio/kamailio/commit/19e5bf3d4cfc2b7d47623e307fff7e60e73e8a18.patch --- diff --git a/src/modules/ndb_redis/ndb_redis_mod.c b/src/modules/ndb_redis/ndb_redis_mod.c index d082bd82ae8..8256c0a619a 100644 --- a/src/modules/ndb_redis/ndb_redis_mod.c +++ b/src/modules/ndb_redis/ndb_redis_mod.c @@ -79,8 +79,9 @@ static int w_redis_execute(struct sip_msg *msg, char *ssrv); static int w_redis_free_reply(struct sip_msg *msg, char *res); -static void mod_destroy(void); +static int mod_init(void); static int child_init(int rank); +static void mod_destroy(void); int bind_ndb_redis(ndb_redis_api_t *api); @@ -146,23 +147,37 @@ static param_export_t params[] = { }; struct module_exports exports = { - "ndb_redis", + "ndb_redis",/* module name */ DEFAULT_DLFLAGS,/* dlopen flags */ - cmds, params, 0,/* exported RPC methods */ + cmds, /* exported functions */ + params, /* exported parameters */ + 0, /* exported RPC methods */ mod_pvs,/* exported pseudo-variables */ 0, /* response function */ - 0, /* module initialization function */ + mod_init, /* module initialization function */ child_init, /* per child init function */ mod_destroy /* destroy function */ }; /* clang-format on */ +/** + * + */ +static int mod_init(void) +{ + /* +* register the need to be called post-fork of all children +* with the special rank PROC_POSTCHILDINIT by main attendant +*/ + ksr_module_set_flag(KSRMOD_FLAG_POSTCHILDINIT); + return 0; +} /* each child get a new connection to the database */ static int child_init(int rank) { - /* skip child init for non-worker process ranks */ - if(rank == PROC_INIT || rank == PROC_MAIN || rank == PROC_TCP_MAIN) + /* skip child init for special process ranks */ + if(rank == PROC_INIT || rank == PROC_MAIN) return 0; if(redisc_init() < 0) { ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:master:99358301: microhttpd: docs - note about variables available in the event route
Module: kamailio Branch: master Commit: 993583015b127b0a83603acd352925c8d6e6db70 URL: https://github.com/kamailio/kamailio/commit/993583015b127b0a83603acd352925c8d6e6db70 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2024-02-26T13:09:27+01:00 microhttpd: docs - note about variables available in the event route --- Modified: src/modules/microhttpd/doc/microhttpd_admin.xml --- Diff: https://github.com/kamailio/kamailio/commit/993583015b127b0a83603acd352925c8d6e6db70.diff Patch: https://github.com/kamailio/kamailio/commit/993583015b127b0a83603acd352925c8d6e6db70.patch --- diff --git a/src/modules/microhttpd/doc/microhttpd_admin.xml b/src/modules/microhttpd/doc/microhttpd_admin.xml index 1967c845b82..c548d0dfc42 100644 --- a/src/modules/microhttpd/doc/microhttpd_admin.xml +++ b/src/modules/microhttpd/doc/microhttpd_admin.xml @@ -157,6 +157,11 @@ event_route[microhttpd:request] { The event route is executed when a new HTTP request is received. + + Inside it, the $mhttpd(...) group of variables is available, giving + access to several attributes of the HTTP request, such as method, + URL, data (body) or headers. + ... ... ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] ndb_reids module in event_route[tcp:closed] route block error: "no redis context for server" (Issue #3768)
That's exactly the code I looked at and said that is there from like 2011, therefore questioning if it really worked differently in 5.4.x vs 5.7.x. The log message might not have been there, but the condition was. If I haven't missed any related commit, it is no major difference in the internal TCP design between 5.4 and 5.7. Anyhow, I will commit an update to initialise the ndb context for tcp-main and look to see if it is needed for the main attendant as well. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3768#issuecomment-1963993740 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
Thansk for merging @miconda ! I wanted to offer a version of the documentation for flag 16 to make it more clear: If bit five is set, then try to find the most closest target from all dispatcher targets with the mandatory ip and combination of local socket, protocol, port. The weighted search result is combined from bit flags of matched components: ip - 1, port - 2, protocol - 4, local socket - 8, the target with the maximum value of flags combination will be selected. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-1963943052 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] TLS certificate decode error / ee key to small with tls_threads_mode = 1 (Issue #3764)
Closed #3764 as completed. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3764#event-11919404871 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] ndb_reids module in event_route[tcp:closed] route block error: "no redis context for server" (Issue #3768)
I suspect that there may be compatibility issues between the new version of the TCP model and the old ndd_redis module during module initialization. I suspect that the processing logic triggered by this event occurred in the main process, which did not initialize the relevant context. I have attempted to modify the following code: ··· file:ndb_redis/ndb_redis_mod.c 151 if(rank == PROC_INIT || rank == PROC_MAIN || rank == PROC_TCP_MAIN) modify: 151 if(rank == PROC_INIT || rank == PROC_MAIN ) ··· Based on the above tests, it can be basically determined that the event_route event was triggered in the TCP main process, rather than in the expected child process, which is also the reason why it cannot obtain the context normally. I'm not sure if this handling is reasonable and won't cause any other problems, but it can indeed run normally. Is there any other better way? I speculate that the related issues should be quite common, whether it is better to solve them from the framework level rather than the module itself. And all operations are handled by the main process, and its performance is also worrying. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3768#issuecomment-1963728833 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] ndb_reids module in event_route[tcp:closed] route block error: "no redis context for server" (Issue #3768)
Can you also provide the output of "kamctl ps" for the same instance from where you get the logs? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3768#issuecomment-1963704189 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] ndb_reids module in event_route[tcp:closed] route block error: "no redis context for server" (Issue #3768)
Kamailio version 5.4.8 can be used normally. I have checked the logs and found that each process successfully initialized the variable, and no other errors were found. I also did not see any other normal business processes that set rsrv ->ctxRedis=NULL. All processes are only released when the program exits. Also, I saw from netstat that all TCP links are in an established state. ``` ... 2024-02-26T06:51:05.272902281Z 77(123) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c1af0 2024-02-26T06:51:05.272906511Z 81(127) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7369 2024-02-26T06:51:05.272919041Z 82(128) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c12b0 2024-02-26T06:51:05.272933851Z 78(124) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c4de0 2024-02-26T06:51:05.272963411Z 77(123) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7369 2024-02-26T06:51:05.285328567Z 81(127) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c2840 2024-02-26T06:51:05.285574157Z 82(128) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7469 2024-02-26T06:51:05.285588327Z 80(126) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.8:7369 2024-02-26T06:51:05.285595027Z 82(128) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c3d10 2024-02-26T06:51:05.285717157Z 81(127) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7369 2024-02-26T06:51:05.285721697Z 82(128) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.9:7369 2024-02-26T06:51:05.285726187Z 78(124) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.8:7469 2024-02-26T06:51:05.285729947Z 82(128) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c3390 2024-02-26T06:51:05.285735627Z 81(127) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c4ad0 2024-02-26T06:51:05.285739987Z 80(126) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c2b10 2024-02-26T06:51:05.285747267Z 75(121) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.8:7369 2024-02-26T06:51:05.285761797Z 82(128) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.8:7369 2024-02-26T06:51:05.285783837Z 82(128) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c2b10 2024-02-26T06:51:05.285787687Z 82(128) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7369 2024-02-26T06:51:05.285791427Z 82(128) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c2e80 2024-02-26T06:51:05.285799057Z 82(128) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7469 2024-02-26T06:51:05.285806657Z 77(123) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c2840 2024-02-26T06:51:05.285813597Z 82(128) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c1af0 2024-02-26T06:51:05.285817647Z 78(124) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c12b0 2024-02-26T06:51:05.285897427Z 82(128) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7369 2024-02-26T06:51:05.285906537Z 82(128) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c2840 2024-02-26T06:51:05.285911297Z 82(128) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7369 2024-02-26T06:51:05.285917977Z 82(128) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c4ad0 2024-02-26T06:51:05.308957137Z 75(121) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c2b10 2024-02-26T06:51:05.309168218Z 80(126) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7369 2024-02-26T06:51:05.309183338Z 80(126) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c2e80 2024-02-26T06:51:05.309187808Z 75(121) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7369 2024-02-26T06:51:05.309192678Z 77(123) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7369 2024-02-26T06:51:05.309198708Z 78(124) DEBUG: ndb_redis [redis_client.c:227]: redisc_init(): Connecting to 12.0.1.7:7469 2024-02-26T06:51:05.309203128Z 77(123) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c4ad0 2024-02-26T06:51:05.309208338Z 75(121) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c2e80 2024-02-26T06:51:05.309212358Z 78(124) DEBUG: ndb_redis [redis_client.c:231]: redisc_init(): rsrv->ctxRedis = 0x5613031c3d10 2024-02-26
[sr-dev] Re: [kamailio/kamailio] TLS certificate decode error / ee key to small with tls_threads_mode = 1 (Issue #3764)
@space88man seems that fixes in current 5.7 branch after #3765 makes it work, so I think this can be closed. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3764#issuecomment-1963614539 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] ndb_reids module in event_route[tcp:closed] route block error: "no redis context for server" (Issue #3768)
My guess is that the event route is executed by tcp-main process and that one has never had the connection to redis, as I looked at the code, it is like that since 2011 or so. Probably what is newer is the log error message. Therefore the question is whether it actually worked to use redis_cmd() in that event rate (it did what it was supposed to do), or it was just no error log message, but the command didn't work? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3768#issuecomment-1963595956 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:master:fb21f89d: ndb_redis: reformat exported structures
Module: kamailio Branch: master Commit: fb21f89dc544551b1bb65805303131fa990d2f44 URL: https://github.com/kamailio/kamailio/commit/fb21f89dc544551b1bb65805303131fa990d2f44 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2024-02-26T07:15:31+01:00 ndb_redis: reformat exported structures --- Modified: src/modules/ndb_redis/ndb_redis_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/fb21f89dc544551b1bb65805303131fa990d2f44.diff Patch: https://github.com/kamailio/kamailio/commit/fb21f89dc544551b1bb65805303131fa990d2f44.patch ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] git:master:65eef5c5: evrexec: reformat exported structures
Module: kamailio Branch: master Commit: 65eef5c5446c1f6870eecf8bbc84d68d12271bc7 URL: https://github.com/kamailio/kamailio/commit/65eef5c5446c1f6870eecf8bbc84d68d12271bc7 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2024-02-26T07:29:26+01:00 evrexec: reformat exported structures --- Modified: src/modules/evrexec/evrexec_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/65eef5c5446c1f6870eecf8bbc84d68d12271bc7.diff Patch: https://github.com/kamailio/kamailio/commit/65eef5c5446c1f6870eecf8bbc84d68d12271bc7.patch --- diff --git a/src/modules/evrexec/evrexec_mod.c b/src/modules/evrexec/evrexec_mod.c index 96493da0fda..3fb99535a0a 100644 --- a/src/modules/evrexec/evrexec_mod.c +++ b/src/modules/evrexec/evrexec_mod.c @@ -74,29 +74,33 @@ void evrexec_process_socket(evrexec_task_t *it, int idx); static int pv_get_evr(sip_msg_t *msg, pv_param_t *param, pv_value_t *res); static int pv_parse_evr_name(pv_spec_p sp, str *in); +/* clang-format off */ static param_export_t params[] = { - {"exec", PARAM_STRING | USE_FUNC_PARAM, (void *)evrexec_param}, - {0, 0, 0}}; + {"exec", PARAM_STRING | USE_FUNC_PARAM, (void *)evrexec_param}, + {0, 0, 0} +}; static pv_export_t mod_pvs[] = { - {{"evr", (sizeof("evr") - 1)}, PVT_OTHER, pv_get_evr, 0, - pv_parse_evr_name, 0, 0, 0}, + {{"evr", (sizeof("evr") - 1)}, PVT_OTHER, pv_get_evr, 0, + pv_parse_evr_name, 0, 0, 0}, - {{0, 0}, 0, 0, 0, 0, 0, 0, 0}}; + {{0, 0}, 0, 0, 0, 0, 0, 0, 0} +}; /** module exports */ struct module_exports exports = { - "evrexec", /* module name */ - DEFAULT_DLFLAGS, /* dlopen flags */ - 0, /* exported functions */ - params, /* exported parameters */ - 0, /* RPC method exports */ - mod_pvs, /* exported pseudo-variables */ - 0, /* response handling function */ - mod_init,/* module initialization function */ - child_init, /* per-child init function */ - 0/* module destroy function */ + "evrexec", /* module name */ + DEFAULT_DLFLAGS, /* dlopen flags */ + 0, /* exported functions */ + params, /* exported parameters */ + 0, /* RPC method exports */ + mod_pvs, /* exported pseudo-variables */ + 0, /* response handling function */ + mod_init,/* module initialization function */ + child_init, /* per-child init function */ + 0/* module destroy function */ }; +/* clang-format on */ static rpc_export_t evr_rpc_methods[]; @@ -583,5 +587,9 @@ void rpc_evr_run(rpc_t *rpc, void *c) /** * */ +/* clang-format off */ static rpc_export_t evr_rpc_methods[] = { - {"evrexec.run", rpc_evr_run, rpc_evr_run_doc, 0}, {0, 0, 0, 0}}; + {"evrexec.run", rpc_evr_run, rpc_evr_run_doc, 0}, + {0, 0, 0, 0} +}; +/* clang-format on */ ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: git:master:8b2573c1: OpenSSL integration: manage curl_global_init(...) used by modules
Hello, do not forget that you have to split the commits per component (e.g., core, module, ...): - https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md#commit-message-rules It makes it easier to review by the maintainer of each component as well as for management in case of need to revert, backport, etc ... When I have to deal with same commit that has to be done for many modules, I use a shell script that I edit to change the commit messages and then run in the root folder with Kamailio sources: """ MODS=`git status | grep "modified:" | grep "src/modules/" | awk '{ print $2 }' | awk -F/ '{ print $1 "/" $2 "/" $3 }' | uniq` for M in $MODS do NAME=`echo $M | awk -F/ '{ print $3 }'` echo "module path: $M" echo "module name: $NAME" git ci -n ${M}/ -m "${NAME}: use literal module name for stats group" -m "- prevent conflicts with global exports" done """ For core I do it separately, it is usually a single commit. Also, backporting has to be done using "git cherry-pick -x ...", like at: - https://www.kamailio.org/wikidocs/devel/backporting-to-3.2.x/#backporting-to-branch-32 This helps to track easier what commits were not backported. Cheers, Daniel On 26.02.24 03:41, S-P Chan via sr-dev wrote: > Module: kamailio > Branch: master > Commit: 8b2573c1f7c5e4bed24f8c5ca09817f613641a03 > URL: > https://github.com/kamailio/kamailio/commit/8b2573c1f7c5e4bed24f8c5ca09817f613641a03 > > Author: S-P Chan > Committer: S-P Chan > Date: 2024-02-26T10:40:19+08:00 > > OpenSSL integration: manage curl_global_init(...) used by modules > > - http_client, http_async_client, xcap_client use libcurl > - call curl_global_init in a thread executor as it invokes > OpenSSL functions on Debian 12 > - clang-format > > --- > > Modified: src/core/rthreads.h > Modified: src/modules/http_async_client/http_multi.c > Modified: src/modules/http_client/http_client.c > Modified: src/modules/xcap_client/xcap_client.c > > --- > > Diff: > https://github.com/kamailio/kamailio/commit/8b2573c1f7c5e4bed24f8c5ca09817f613641a03.diff > Patch: > https://github.com/kamailio/kamailio/commit/8b2573c1f7c5e4bed24f8c5ca09817f613641a03.patch > > ___ > Kamailio (SER) - Development Mailing List > To unsubscribe send an email to sr-dev-le...@lists.kamailio.org -- Daniel-Constantin Mierla (@ asipto.com) twitter.com/miconda -- linkedin.com/in/miconda Kamailio Consultancy, Training and Development Services -- asipto.com Kamailio World Conference, April 18-19, 2024, Berlin -- kamailioworld.com ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org