kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
February 2024
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
19 participants
242 discussions
Start a n
N
ew thread
git:master:59230a07: tcpops: variables to get active connection attributes
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 59230a07b8c6a79c4a574890bae775c3d166c471 URL:
https://github.com/kamailio/kamailio/commit/59230a07b8c6a79c4a574890bae775c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> 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/59230a07b8c6a79c4a574890bae775c…
Patch:
https://github.com/kamailio/kamailio/commit/59230a07b8c6a79c4a574890bae775c…
--- 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; }
9 months, 4 weeks
1
0
0
0
git:5.7:1d9ea67e: http_async_client: libssl refactor thread executors for curl
by S-P Chan
Module: kamailio Branch: 5.7 Commit: 1d9ea67eb29b4fd45c00a00581e7b73a9b42c8ce URL:
https://github.com/kamailio/kamailio/commit/1d9ea67eb29b4fd45c00a00581e7b73…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/1d9ea67eb29b4fd45c00a00581e7b73…
Patch:
https://github.com/kamailio/kamailio/commit/1d9ea67eb29b4fd45c00a00581e7b73…
--- 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); }
9 months, 4 weeks
1
0
0
0
git:5.8:bc4c2069: http_async_client: libssl refactor thread executors for curl
by S-P Chan
Module: kamailio Branch: 5.8 Commit: bc4c206999094ed74e77c73f5537e857111d0a30 URL:
https://github.com/kamailio/kamailio/commit/bc4c206999094ed74e77c73f5537e85…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)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/bc4c206999094ed74e77c73f5537e85…
Patch:
https://github.com/kamailio/kamailio/commit/bc4c206999094ed74e77c73f5537e85…
--- 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); }
9 months, 4 weeks
1
0
0
0
git:master:6a0c86bb: http_async_client: libssl refactor thread executors for curl
by S-P Chan
Module: kamailio Branch: master Commit: 6a0c86bba8ff1200b8fe9197f2a76688a9948808 URL:
https://github.com/kamailio/kamailio/commit/6a0c86bba8ff1200b8fe9197f2a7668…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/6a0c86bba8ff1200b8fe9197f2a7668…
Patch:
https://github.com/kamailio/kamailio/commit/6a0c86bba8ff1200b8fe9197f2a7668…
--- 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); }
9 months, 4 weeks
1
0
0
0
git:5.7:8098136c: xcap_client: libssl thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: 5.7 Commit: 8098136ccbe2050b499d3d962c44d58203afc370 URL:
https://github.com/kamailio/kamailio/commit/8098136ccbe2050b499d3d962c44d58…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/8098136ccbe2050b499d3d962c44d58…
Patch:
https://github.com/kamailio/kamailio/commit/8098136ccbe2050b499d3d962c44d58…
--- 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);
9 months, 4 weeks
1
0
0
0
git:5.7:d9285fc7: http_client: libssl thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: 5.7 Commit: d9285fc741c2a3c3995e037c23393df108e94bf1 URL:
https://github.com/kamailio/kamailio/commit/d9285fc741c2a3c3995e037c23393df…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/d9285fc741c2a3c3995e037c23393df…
Patch:
https://github.com/kamailio/kamailio/commit/d9285fc741c2a3c3995e037c23393df…
--- 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; }
9 months, 4 weeks
1
0
0
0
git:5.7:d01b6e22: http_async_client: libssl thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: 5.7 Commit: d01b6e22e083c6fab457f8fbe1c8ac2526a37d30 URL:
https://github.com/kamailio/kamailio/commit/d01b6e22e083c6fab457f8fbe1c8ac2…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/d01b6e22e083c6fab457f8fbe1c8ac2…
Patch:
https://github.com/kamailio/kamailio/commit/d01b6e22e083c6fab457f8fbe1c8ac2…
--- 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); }
9 months, 4 weeks
1
0
0
0
git:5.7:0f1d78a2: core/rthreads.h: add thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: 5.7 Commit: 0f1d78a22aeefef7601d0cf646ec154f5e52c175 URL:
https://github.com/kamailio/kamailio/commit/0f1d78a22aeefef7601d0cf646ec154…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/0f1d78a22aeefef7601d0cf646ec154…
Patch:
https://github.com/kamailio/kamailio/commit/0f1d78a22aeefef7601d0cf646ec154…
--- 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
9 months, 4 weeks
1
0
0
0
git:5.7:f850f4ee: Revert ed9d7bc58b - split into per module commits
by S-P Chan
Module: kamailio Branch: 5.7 Commit: f850f4eef66b6461bb93ede9bf67b52458e18856 URL:
https://github.com/kamailio/kamailio/commit/f850f4eef66b6461bb93ede9bf67b52…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/f850f4eef66b6461bb93ede9bf67b52…
Patch:
https://github.com/kamailio/kamailio/commit/f850f4eef66b6461bb93ede9bf67b52…
--- 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);
9 months, 4 weeks
1
0
0
0
git:5.8:53398940: xcap_client: libssl thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: 5.8 Commit: 533989406d0fa1e57ff007fd8d7f702f5831dacd URL:
https://github.com/kamailio/kamailio/commit/533989406d0fa1e57ff007fd8d7f702…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/533989406d0fa1e57ff007fd8d7f702…
Patch:
https://github.com/kamailio/kamailio/commit/533989406d0fa1e57ff007fd8d7f702…
--- 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);
9 months, 4 weeks
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
25
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Results per page:
10
25
50
100
200