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
2025
May
April
March
February
January
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
November 2023
----- 2025 -----
May 2025
April 2025
March 2025
February 2025
January 2025
----- 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
15 participants
391 discussions
Start a n
N
ew thread
git:master:c6feb52c: app_lua: reformat exports structures
by Daniel-Constantin Mierla
21 Nov '23
21 Nov '23
Module: kamailio Branch: master Commit: c6feb52c97bbd3fc33dc837d2b23e56c75f09583 URL:
https://github.com/kamailio/kamailio/commit/c6feb52c97bbd3fc33dc837d2b23e56…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-11-21T15:39:21+01:00 app_lua: reformat exports structures --- Modified: src/modules/app_lua/app_lua_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/c6feb52c97bbd3fc33dc837d2b23e56…
Patch:
https://github.com/kamailio/kamailio/commit/c6feb52c97bbd3fc33dc837d2b23e56…
--- diff --git a/src/modules/app_lua/app_lua_mod.c b/src/modules/app_lua/app_lua_mod.c index 5a554f03aba..1aa4579d489 100644 --- a/src/modules/app_lua/app_lua_mod.c +++ b/src/modules/app_lua/app_lua_mod.c @@ -62,39 +62,47 @@ int app_lua_reload_param(modparam_t type, void *val); int _ksr_app_lua_log_mode = 0; +/* clang-format off */ static param_export_t params[] = { - {"load", PARAM_STRING | USE_FUNC_PARAM, (void *)app_lua_load_param}, - {"reload", INT_PARAM | USE_FUNC_PARAM, (void *)app_lua_reload_param}, - {"log_mode", PARAM_INT, &_ksr_app_lua_log_mode}, {0, 0, 0}}; - -static cmd_export_t cmds[] = {{"lua_dostring", (cmd_function)w_app_lua_dostring, - 1, fixup_spve_null, 0, ANY_ROUTE}, - {"lua_dofile", (cmd_function)w_app_lua_dofile, 1, fixup_spve_null, 0, - ANY_ROUTE}, - {"lua_runstring", (cmd_function)w_app_lua_runstring, 1, fixup_spve_null, - 0, ANY_ROUTE}, - {"lua_run", (cmd_function)w_app_lua_run0, 1, fixup_lua_run, 0, - ANY_ROUTE}, - {"lua_run", (cmd_function)w_app_lua_run1, 2, fixup_lua_run, 0, - ANY_ROUTE}, - {"lua_run", (cmd_function)w_app_lua_run2, 3, fixup_lua_run, 0, - ANY_ROUTE}, - {"lua_run", (cmd_function)w_app_lua_run3, 4, fixup_lua_run, 0, - ANY_ROUTE}, - {"bind_app_lua", (cmd_function)bind_app_lua, 0, 0, 0, ANY_ROUTE}, - {0, 0, 0, 0, 0, 0}}; + {"load", PARAM_STRING | USE_FUNC_PARAM, (void *)app_lua_load_param}, + {"reload", INT_PARAM | USE_FUNC_PARAM, (void *)app_lua_reload_param}, + {"log_mode", PARAM_INT, &_ksr_app_lua_log_mode}, + {0, 0, 0} +}; + +static cmd_export_t cmds[] = { + {"lua_dostring", (cmd_function)w_app_lua_dostring, 1, + fixup_spve_null, 0, ANY_ROUTE}, + {"lua_dofile", (cmd_function)w_app_lua_dofile, 1, + fixup_spve_null, 0, ANY_ROUTE}, + {"lua_runstring", (cmd_function)w_app_lua_runstring, 1, + fixup_spve_null, 0, ANY_ROUTE}, + {"lua_run", (cmd_function)w_app_lua_run0, 1, + fixup_lua_run, 0, ANY_ROUTE}, + {"lua_run", (cmd_function)w_app_lua_run1, 2, + fixup_lua_run, 0, ANY_ROUTE}, + {"lua_run", (cmd_function)w_app_lua_run2, 3, + fixup_lua_run, 0, ANY_ROUTE}, + {"lua_run", (cmd_function)w_app_lua_run3, 4, + fixup_lua_run, 0, ANY_ROUTE}, + {"bind_app_lua", (cmd_function)bind_app_lua, 0, + 0, 0, ANY_ROUTE}, + {0, 0, 0, 0, 0, 0} +}; struct module_exports exports = { - "app_lua", DEFAULT_DLFLAGS, /* dlopen flags */ - cmds, /*��exported��functions��*/ - params, /*��exported��params��*/ - 0, /*��exported��RPC��methods��*/ - 0, /* exported pseudo-variables */ - 0, /*��response��function��*/ - mod_init, /* initialization module*/ - child_init, /* per child init function */ - mod_destroy /* destroy function */ + "app_lua", /* module name */ + DEFAULT_DLFLAGS, /* dlopen flags */ + cmds, /* exported functions */ + params, /* exported params */ + 0, /* exported RPC methods */ + 0, /* exported pseudo-variables */ + 0, /* response function */ + mod_init, /* initialization module */ + child_init, /* per child init function */ + mod_destroy /* destroy function */ }; +/* clang-format on */ /** *
1
0
0
0
git:master:ebe77a20: app_python3s: use module name prefix for exports structure
by Daniel-Constantin Mierla
21 Nov '23
21 Nov '23
Module: kamailio Branch: master Commit: ebe77a2068c5073b436a1f8fefdfd689c9010816 URL:
https://github.com/kamailio/kamailio/commit/ebe77a2068c5073b436a1f8fefdfd68…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-11-21T15:35:04+01:00 app_python3s: use module name prefix for exports structure --- Modified: src/modules/app_python3s/app_python3s_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/ebe77a2068c5073b436a1f8fefdfd68…
Patch:
https://github.com/kamailio/kamailio/commit/ebe77a2068c5073b436a1f8fefdfd68…
--- diff --git a/src/modules/app_python3s/app_python3s_mod.c b/src/modules/app_python3s/app_python3s_mod.c index 119d8ef071a..91562f99aec 100644 --- a/src/modules/app_python3s/app_python3s_mod.c +++ b/src/modules/app_python3s/app_python3s_mod.c @@ -83,7 +83,7 @@ static cmd_export_t cmds[] = { }; /** module exports */ -struct module_exports exports = { +struct module_exports _app_python3s_exports = { "app_python3s", /* module name */ RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */ cmds, /* exported functions */
1
0
0
0
git:master:9fb9cbdd: app_python3s: reformat exports structures
by Daniel-Constantin Mierla
21 Nov '23
21 Nov '23
Module: kamailio Branch: master Commit: 9fb9cbddee8974a1733b999807cc1943248753f7 URL:
https://github.com/kamailio/kamailio/commit/9fb9cbddee8974a1733b999807cc194…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-11-21T15:32:57+01:00 app_python3s: reformat exports structures --- Modified: src/modules/app_python3s/app_python3s_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/9fb9cbddee8974a1733b999807cc194…
Patch:
https://github.com/kamailio/kamailio/commit/9fb9cbddee8974a1733b999807cc194…
--- diff --git a/src/modules/app_python3s/app_python3s_mod.c b/src/modules/app_python3s/app_python3s_mod.c index d549f972333..119d8ef071a 100644 --- a/src/modules/app_python3s/app_python3s_mod.c +++ b/src/modules/app_python3s/app_python3s_mod.c @@ -60,37 +60,42 @@ PyThreadState *myThreadState = NULL; int apy3s_script_init_exec(PyObject *pModule, str *fname, int *vparam); +/* clang-format off */ /** module parameters */ -static param_export_t params[] = {{"load", PARAM_STR, &_sr_python_load_file}, - {"script_init", PARAM_STR, &_sr_apy3s_script_init}, - {"script_child_init", PARAM_STR, &_sr_apy3s_script_child_init}, +static param_export_t params[] = { + {"load", PARAM_STR, &_sr_python_load_file}, + {"script_init", PARAM_STR, &_sr_apy3s_script_init}, + {"script_child_init", PARAM_STR, &_sr_apy3s_script_child_init}, - {0, 0, 0}}; + {0, 0, 0} +}; /* * Exported functions */ static cmd_export_t cmds[] = { - {"app_python3s_exec", (cmd_function)w_app_python3s_exec1, 1, - fixup_spve_null, 0, ANY_ROUTE}, - {"app_python3s_exec", (cmd_function)w_app_python3s_exec2, 2, - fixup_spve_spve, 0, ANY_ROUTE}, + {"app_python3s_exec", (cmd_function)w_app_python3s_exec1, 1, + fixup_spve_null, 0, ANY_ROUTE}, + {"app_python3s_exec", (cmd_function)w_app_python3s_exec2, 2, + fixup_spve_spve, 0, ANY_ROUTE}, - {0, 0, 0, 0, 0, 0}}; + {0, 0, 0, 0, 0, 0} +}; /** module exports */ struct module_exports exports = { - "app_python3s", /* module name */ - RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */ - cmds, /* exported functions */ - params, /* exported parameters */ - 0, /* exported rpc functions */ - 0, /* exported pseudo-variables */ - 0, /* response handling function */ - mod_init, /* module init function */ - child_init, /* per-child init function */ - mod_destroy /* destroy function */ + "app_python3s", /* module name */ + RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */ + cmds, /* exported functions */ + params, /* exported parameters */ + 0, /* exported rpc functions */ + 0, /* exported pseudo-variables */ + 0, /* response handling function */ + mod_init, /* module init function */ + child_init, /* per-child init function */ + mod_destroy /* destroy function */ }; +/* clang-format on */ /**
1
0
0
0
git:master:114d6fe5: app_python3: use module name prefix for exports structure
by Daniel-Constantin Mierla
21 Nov '23
21 Nov '23
Module: kamailio Branch: master Commit: 114d6fe510d7c1876782054ed89e4017d39d5f69 URL:
https://github.com/kamailio/kamailio/commit/114d6fe510d7c1876782054ed89e401…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-11-21T15:29:49+01:00 app_python3: use module name prefix for exports structure --- Modified: src/modules/app_python3/app_python3_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/114d6fe510d7c1876782054ed89e401…
Patch:
https://github.com/kamailio/kamailio/commit/114d6fe510d7c1876782054ed89e401…
--- diff --git a/src/modules/app_python3/app_python3_mod.c b/src/modules/app_python3/app_python3_mod.c index e5024b0cb87..29316434e76 100644 --- a/src/modules/app_python3/app_python3_mod.c +++ b/src/modules/app_python3/app_python3_mod.c @@ -83,7 +83,7 @@ static cmd_export_t cmds[] = { }; /** module exports */ -struct module_exports exports = { +struct module_exports _app_python3_exports = { "app_python3", /* module name */ RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */ cmds, /* exported functions */
1
0
0
0
git:master:042bb9d1: app_python3: reformat exports structures
by Daniel-Constantin Mierla
21 Nov '23
21 Nov '23
Module: kamailio Branch: master Commit: 042bb9d10e12a256f9e4461031347e09b89fbe98 URL:
https://github.com/kamailio/kamailio/commit/042bb9d10e12a256f9e4461031347e0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-11-21T15:26:23+01:00 app_python3: reformat exports structures --- Modified: src/modules/app_python3/app_python3_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/042bb9d10e12a256f9e4461031347e0…
Patch:
https://github.com/kamailio/kamailio/commit/042bb9d10e12a256f9e4461031347e0…
--- diff --git a/src/modules/app_python3/app_python3_mod.c b/src/modules/app_python3/app_python3_mod.c index 45dde5268c4..e5024b0cb87 100644 --- a/src/modules/app_python3/app_python3_mod.c +++ b/src/modules/app_python3/app_python3_mod.c @@ -61,35 +61,41 @@ int _apy_process_rank = 0; PyThreadState *myThreadState; +/* clang-format off */ /** module parameters */ static param_export_t params[] = { - {"script_name", PARAM_STR, &_sr_python_load_file}, - {"load", PARAM_STR, &_sr_python_load_file}, - {"mod_init_function", PARAM_STR, &mod_init_fname}, - {"child_init_method", PARAM_STR, &child_init_mname}, {0, 0, 0}}; + {"script_name", PARAM_STR, &_sr_python_load_file}, + {"load", PARAM_STR, &_sr_python_load_file}, + {"mod_init_function", PARAM_STR, &mod_init_fname}, + {"child_init_method", PARAM_STR, &child_init_mname}, + {0, 0, 0} +}; /* * Exported functions */ -static cmd_export_t cmds[] = {{"python_exec", (cmd_function)python_exec1, 1, - fixup_spve_null, 0, ANY_ROUTE}, - {"python_exec", (cmd_function)python_exec2, 2, fixup_spve_spve, 0, - ANY_ROUTE}, - {0, 0, 0, 0, 0, 0}}; +static cmd_export_t cmds[] = { + {"python_exec", (cmd_function)python_exec1, 1, + fixup_spve_null, 0, ANY_ROUTE}, + {"python_exec", (cmd_function)python_exec2, 2, + fixup_spve_spve, 0, ANY_ROUTE}, + {0, 0, 0, 0, 0, 0} +}; /** module exports */ struct module_exports exports = { - "app_python3", /* module name */ - RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */ - cmds, /* exported functions */ - params, /* exported parameters */ - 0, /* exported rpc functions */ - 0, /* exported pseudo-variables */ - 0, /* response handling function */ - mod_init, /* module init function */ - child_init, /* per-child init function */ - mod_destroy /* destroy function */ + "app_python3", /* module name */ + RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */ + cmds, /* exported functions */ + params, /* exported parameters */ + 0, /* exported rpc functions */ + 0, /* exported pseudo-variables */ + 0, /* response handling function */ + mod_init, /* module init function */ + child_init, /* per-child init function */ + mod_destroy /* destroy function */ }; +/* clang-format on */ /**
1
0
0
0
git:master:1623f9ed: core: resolve - variables initialisation
by Daniel-Constantin Mierla
21 Nov '23
21 Nov '23
Module: kamailio Branch: master Commit: 1623f9ed1728455b72abf0a74f06bfd24365cefb URL:
https://github.com/kamailio/kamailio/commit/1623f9ed1728455b72abf0a74f06bfd…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-11-21T15:14:39+01:00 core: resolve - variables initialisation --- Modified: src/core/resolve.c --- Diff:
https://github.com/kamailio/kamailio/commit/1623f9ed1728455b72abf0a74f06bfd…
Patch:
https://github.com/kamailio/kamailio/commit/1623f9ed1728455b72abf0a74f06bfd…
--- diff --git a/src/core/resolve.c b/src/core/resolve.c index 36ea073bc5b..b6ee8592697 100644 --- a/src/core/resolve.c +++ b/src/core/resolve.c @@ -1511,7 +1511,7 @@ size_t create_srv_pref_list(char *proto, struct dns_srv_proto *list) { struct dns_srv_proto tmp; size_t i, j, list_len; - int default_order, max; + int default_order = 1, max; /* if proto available, then add only the forced protocol to the list */ if(proto && *proto != PROTO_NONE) { @@ -1661,7 +1661,7 @@ struct hostent *naptr_sip_resolvehost( char n_proto; str srv_name; naptr_bmp_t tried_bmp; /* tried bitmap */ - char origproto; + char origproto = PROTO_NONE; if(proto) origproto = *proto;
1
0
0
0
git:master:dc7f2eca: core: tcp - init local variables and define function only when needed
by Daniel-Constantin Mierla
21 Nov '23
21 Nov '23
Module: kamailio Branch: master Commit: dc7f2eca21eb6493f3c215eeb21e0a37a6e813c6 URL:
https://github.com/kamailio/kamailio/commit/dc7f2eca21eb6493f3c215eeb21e0a3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-11-21T14:33:29+01:00 core: tcp - init local variables and define function only when needed --- Modified: src/core/tcp_main.c --- Diff:
https://github.com/kamailio/kamailio/commit/dc7f2eca21eb6493f3c215eeb21e0a3…
Patch:
https://github.com/kamailio/kamailio/commit/dc7f2eca21eb6493f3c215eeb21e0a3…
--- diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c index 855b2d80617..3d4a6a4e0b1 100644 --- a/src/core/tcp_main.c +++ b/src/core/tcp_main.c @@ -2064,15 +2064,15 @@ int tcp_send(struct dest_info *dst, union sockaddr_union *from, const char *buf, struct tcp_connection *c; struct ip_addr ip; int port; - int fd; + int fd = -1; long response[2]; int n; ticks_t con_lifetime; int try_local_port; #ifdef USE_TLS - const char *rest_buf; - const char *t_buf; - unsigned rest_len, t_len; + const char *rest_buf = NULL; + const char *t_buf = NULL; + unsigned rest_len = 0, t_len = 0; long resp; snd_flags_t t_send_flags; #endif /* USE_TLS */ @@ -3548,6 +3548,7 @@ static void destroy_send_fd_queues(void) } +#ifdef SEND_FD_QUEUE inline static int send_fd_queue_add( struct tcp_send_fd_q *q, int unix_sock, struct tcp_connection *t) { @@ -3585,7 +3586,7 @@ inline static int send_fd_queue_add( error: return -1; } - +#endif inline static void send_fd_queue_run(struct tcp_send_fd_q *q) {
1
0
0
0
git:master:d0a35334: core/mem: tlsf - cast to char* for pointer operations
by Daniel-Constantin Mierla
21 Nov '23
21 Nov '23
Module: kamailio Branch: master Commit: d0a353342b559191aafc732174773e132554694a URL:
https://github.com/kamailio/kamailio/commit/d0a353342b559191aafc732174773e1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-11-21T13:57:52+01:00 core/mem: tlsf - cast to char* for pointer operations --- Modified: src/core/mem/tlsf_malloc.c --- Diff:
https://github.com/kamailio/kamailio/commit/d0a353342b559191aafc732174773e1…
Patch:
https://github.com/kamailio/kamailio/commit/d0a353342b559191aafc732174773e1…
--- diff --git a/src/core/mem/tlsf_malloc.c b/src/core/mem/tlsf_malloc.c index f7cdeab5eec..e599f84aff9 100644 --- a/src/core/mem/tlsf_malloc.c +++ b/src/core/mem/tlsf_malloc.c @@ -1058,9 +1058,10 @@ void tlsf_free(tlsf_t tlsf, void *ptr) control->allocated -= block_size(block); control->real_used -= (block_size(block) - + (ptr - - (void *)block - /* prev_phys_block is melted in the previous block when the current block is used */ + + ((char *)ptr + - (char *)block + /* prev_phys_block is melted in the previous + * block when the current block is used */ + sizeof(block->prev_phys_block))); #ifdef DBG_TLSF_MALLOC block->alloc_info.file = file;
1
0
0
0
git:master:30c42aab: core: resolve - cast after pointer operations for RES_AR
by Daniel-Constantin Mierla
21 Nov '23
21 Nov '23
Module: kamailio Branch: master Commit: 30c42aab767d777e3beb1493165458489957e92d URL:
https://github.com/kamailio/kamailio/commit/30c42aab767d777e3beb14931654584…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-11-21T13:30:26+01:00 core: resolve - cast after pointer operations for RES_AR --- Modified: src/core/resolve.c --- Diff:
https://github.com/kamailio/kamailio/commit/30c42aab767d777e3beb14931654584…
Patch:
https://github.com/kamailio/kamailio/commit/30c42aab767d777e3beb14931654584…
--- diff --git a/src/core/resolve.c b/src/core/resolve.c index 56d189f1ab1..36ea073bc5b 100644 --- a/src/core/resolve.c +++ b/src/core/resolve.c @@ -1026,7 +1026,7 @@ struct rdata *get_record(char *name, int type, int flags) /* check if enough space is left for type, class, ttl & size */ if(unlikely((p + 2 + 2 + 4 + 2) > end)) goto error_boundary; - memcpy((void *)&rdlength, (void *)p + 2 + 2 + 4, 2); + memcpy((void *)&rdlength, (void *)(p + 2 + 2 + 4), 2); p += 2 + 2 + 4 + 2 + ntohs(rdlength); } answers_no = ntohs((unsigned short)buff.hdr.arcount);
1
0
0
0
git:master:2da8060f: pipelimit: init cpu load metrics and check returned value of fscanf()
by Daniel-Constantin Mierla
21 Nov '23
21 Nov '23
Module: kamailio Branch: master Commit: 2da8060f67f09949e11f77a281fcb4e3e5def582 URL:
https://github.com/kamailio/kamailio/commit/2da8060f67f09949e11f77a281fcb4e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-11-21T13:27:24+01:00 pipelimit: init cpu load metrics and check returned value of fscanf() --- Modified: src/modules/pipelimit/pipelimit.c Modified: src/modules/pipelimit/pl_ht.c Modified: src/modules/pipelimit/pl_statistics.c --- Diff:
https://github.com/kamailio/kamailio/commit/2da8060f67f09949e11f77a281fcb4e…
Patch:
https://github.com/kamailio/kamailio/commit/2da8060f67f09949e11f77a281fcb4e…
--- diff --git a/src/modules/pipelimit/pipelimit.c b/src/modules/pipelimit/pipelimit.c index e9fc83b7920..625da0e50dd 100644 --- a/src/modules/pipelimit/pipelimit.c +++ b/src/modules/pipelimit/pipelimit.c @@ -214,13 +214,16 @@ int get_num_cpus() /* not using /proc/loadavg because it only works when our_timer_interval == theirs */ static int get_cpuload(double *load) { - static long long o_user, o_nice, o_sys, o_idle, o_iow, o_irq, o_sirq, o_stl; - long long n_user, n_nice, n_sys, n_idle, n_iow, n_irq, n_sirq, n_stl; + static long long o_user = 0, o_nice = 0, o_sys = 0, o_idle = 0, o_iow = 0, + o_irq = 0, o_sirq = 0, o_stl = 0; + long long n_user = 0, n_nice = 0, n_sys = 0, n_idle = 0, n_iow = 0, + n_irq = 0, n_sirq = 0, n_stl = 0; static int first_time = 1; FILE *f = fopen("/proc/stat", "r"); - double vload; - int ncpu; + double vload = 0.0; + int ncpu = 0; static int errormsg = 0; + int n = 0; if(!f) { /* Only write this error message five times. Otherwise you will annoy @@ -231,9 +234,9 @@ static int get_cpuload(double *load) } return -1; } - if(fscanf(f, "cpu %lld%lld%lld%lld%lld%lld%lld%lld", &n_user, &n_nice, - &n_sys, &n_idle, &n_iow, &n_irq, &n_sirq, &n_stl) - < 0) { + n = fscanf(f, "cpu %lld%lld%lld%lld%lld%lld%lld%lld", &n_user, &n_nice, + &n_sys, &n_idle, &n_iow, &n_irq, &n_sirq, &n_stl); + if(n < 8) { LM_ERR("could not parse load information\n"); fclose(f); return -1; diff --git a/src/modules/pipelimit/pl_ht.c b/src/modules/pipelimit/pl_ht.c index 5f9b52dfc4a..c4e30de6190 100644 --- a/src/modules/pipelimit/pl_ht.c +++ b/src/modules/pipelimit/pl_ht.c @@ -56,6 +56,7 @@ str_map_t algo_names[] = { int pl_init_htable(unsigned int hsize) { int i; + int j; if(_pl_pipes_ht != NULL) return -1; @@ -80,10 +81,10 @@ int pl_init_htable(unsigned int hsize) for(i = 0; i < _pl_pipes_ht->htsize; i++) { if(lock_init(&_pl_pipes_ht->slots[i].lock) == 0) { LM_ERR("cannot initialize lock[%d]\n", i); - i--; - while(i >= 0) { - lock_destroy(&_pl_pipes_ht->slots[i].lock); - i--; + j = i - 1; + while(j >= 0) { + lock_destroy(&_pl_pipes_ht->slots[j].lock); + j--; } shm_free(_pl_pipes_ht->slots); shm_free(_pl_pipes_ht); diff --git a/src/modules/pipelimit/pl_statistics.c b/src/modules/pipelimit/pl_statistics.c index c350acb0fc1..40d48b0a7c3 100644 --- a/src/modules/pipelimit/pl_statistics.c +++ b/src/modules/pipelimit/pl_statistics.c @@ -184,7 +184,7 @@ int get_socket_list_from_proto_and_family( return 0; } - *ipList = pkg_malloc(numberOfSockets * (num_ip_octets + 1) * sizeof(int)); + *ipList = pkg_malloc(sizeof(int) * numberOfSockets * (num_ip_octets + 1)); /* We couldn't allocate memory for the IP List. So all we can do is * fail. */
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
40
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Results per page:
10
25
50
100
200