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
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 -----
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:5.8:49c3290f: http_client: libssl thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: 5.8 Commit: 49c3290fc6eb50de0b08661c50ff42663ff3de6b URL:
https://github.com/kamailio/kamailio/commit/49c3290fc6eb50de0b08661c50ff426…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/49c3290fc6eb50de0b08661c50ff426…
Patch:
https://github.com/kamailio/kamailio/commit/49c3290fc6eb50de0b08661c50ff426…
--- 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; } }
8 months, 4 weeks
1
0
0
0
git:5.8:5d4fae5c: http_async_client: libssl thread executor for curl_global_init()
by S-P Chan
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); }
8 months, 4 weeks
1
0
0
0
git:5.8:ce17fee3: core/rthreads.h: add thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: 5.8 Commit: ce17fee304e9ffa5046194a0827f771742113640 URL:
https://github.com/kamailio/kamailio/commit/ce17fee304e9ffa5046194a0827f771…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/ce17fee304e9ffa5046194a0827f771…
Patch:
https://github.com/kamailio/kamailio/commit/ce17fee304e9ffa5046194a0827f771…
--- 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
8 months, 4 weeks
1
0
0
0
git:5.8:b1a30880: Revert ac4f1be039 - split into per module commits
by S-P Chan
Module: kamailio Branch: 5.8 Commit: b1a308801430a5561c4c13c1d4602fe5d5542cf8 URL:
https://github.com/kamailio/kamailio/commit/b1a308801430a5561c4c13c1d4602fe…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/b1a308801430a5561c4c13c1d4602fe…
Patch:
https://github.com/kamailio/kamailio/commit/b1a308801430a5561c4c13c1d4602fe…
8 months, 4 weeks
1
0
0
0
git:master:f5164b39: xcap_client: libssl thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: master Commit: f5164b39c8b61792e9cf396cfcd0fe3ba567bb86 URL:
https://github.com/kamailio/kamailio/commit/f5164b39c8b61792e9cf396cfcd0fe3…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/f5164b39c8b61792e9cf396cfcd0fe3…
Patch:
https://github.com/kamailio/kamailio/commit/f5164b39c8b61792e9cf396cfcd0fe3…
--- 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);
8 months, 4 weeks
1
0
0
0
git:master:f5822595: http_client: libssl thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: master Commit: f58225950cc2bfa63a230a3bc8460bbcbfa7738e URL:
https://github.com/kamailio/kamailio/commit/f58225950cc2bfa63a230a3bc8460bb…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/f58225950cc2bfa63a230a3bc8460bb…
Patch:
https://github.com/kamailio/kamailio/commit/f58225950cc2bfa63a230a3bc8460bb…
--- 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; } }
8 months, 4 weeks
1
0
0
0
git:master:514635dc: http_async_client: libssl thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: master Commit: 514635dc3e6182ff0daaebe548ed613edc2de61f URL:
https://github.com/kamailio/kamailio/commit/514635dc3e6182ff0daaebe548ed613…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)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/514635dc3e6182ff0daaebe548ed613…
Patch:
https://github.com/kamailio/kamailio/commit/514635dc3e6182ff0daaebe548ed613…
--- 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); }
8 months, 4 weeks
1
0
0
0
git:master:db054499: core/rthreads.h: add thread executor for curl_global_init()
by S-P Chan
Module: kamailio Branch: master Commit: db05449932b1753d4b705f88445533bbe1ed6475 URL:
https://github.com/kamailio/kamailio/commit/db05449932b1753d4b705f88445533b…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/db05449932b1753d4b705f88445533b…
Patch:
https://github.com/kamailio/kamailio/commit/db05449932b1753d4b705f88445533b…
--- 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
8 months, 4 weeks
1
0
0
0
git:master:272a4e08: Revert 8b2573c1f7 - split into per module commits
by S-P Chan
Module: kamailio Branch: master Commit: 272a4e08be61870cd7788c8cd8dd9be29b50753f URL:
https://github.com/kamailio/kamailio/commit/272a4e08be61870cd7788c8cd8dd9be…
Author: S-P Chan <shihping.chan(a)gmail.com> Committer: S-P Chan <shihping.chan(a)gmail.com> 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/272a4e08be61870cd7788c8cd8dd9be…
Patch:
https://github.com/kamailio/kamailio/commit/272a4e08be61870cd7788c8cd8dd9be…
8 months, 4 weeks
1
0
0
0
git:master:19e5bf3d: ndb_redis: init enabled for tcp-main and postchildinit callbacks
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 19e5bf3d4cfc2b7d47623e307fff7e60e73e8a18 URL:
https://github.com/kamailio/kamailio/commit/19e5bf3d4cfc2b7d47623e307fff7e6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> 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/19e5bf3d4cfc2b7d47623e307fff7e6…
Patch:
https://github.com/kamailio/kamailio/commit/19e5bf3d4cfc2b7d47623e307fff7e6…
--- 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) {
8 months, 4 weeks
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
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