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
January 2016
----- 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
34 participants
295 discussions
Start a n
N
ew thread
git:master:b5e16b18: statsc: removed unused variable
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: b5e16b18d889c84ae69ec03b91b9cc635e80c3ee URL:
https://github.com/kamailio/kamailio/commit/b5e16b18d889c84ae69ec03b91b9cc6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-01-22T19:31:36+01:00 statsc: removed unused variable --- Modified: modules/statsc/statsc_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/b5e16b18d889c84ae69ec03b91b9cc6…
Patch:
https://github.com/kamailio/kamailio/commit/b5e16b18d889c84ae69ec03b91b9cc6…
--- diff --git a/modules/statsc/statsc_mod.c b/modules/statsc/statsc_mod.c index d746e1a..1caccd9 100644 --- a/modules/statsc/statsc_mod.c +++ b/modules/statsc/statsc_mod.c @@ -319,7 +319,7 @@ static void statsc_rpc_report(rpc_t* rpc, void* ctx) int cmode; str sname; int range; - int k, n, r, m, v; + int k, m, n, v; time_t tn; void* th; void* ts;
8 years, 11 months
1
0
0
0
git:master:41c3e93a: statsc: updates to readme file
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 41c3e93afd9d365ba831705632925bb18fbdd9c2 URL:
https://github.com/kamailio/kamailio/commit/41c3e93afd9d365ba831705632925bb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-01-22T19:29:59+01:00 statsc: updates to readme file --- Modified: modules/statsc/README --- Diff:
https://github.com/kamailio/kamailio/commit/41c3e93afd9d365ba831705632925bb…
Patch:
https://github.com/kamailio/kamailio/commit/41c3e93afd9d365ba831705632925bb…
--- diff --git a/modules/statsc/README b/modules/statsc/README index d87677b..c35bbe7 100644 --- a/modules/statsc/README +++ b/modules/statsc/README @@ -27,6 +27,7 @@ Daniel-Constantin Mierla 3.1. interval (int) 3.2. items (int) + 3.3. track (str) 4. RPC Commands @@ -36,6 +37,7 @@ Daniel-Constantin Mierla 1.1. Set interval parameter 1.2. Set items parameter + 1.3. Set track parameter Chapter 1. Admin Guide @@ -51,6 +53,7 @@ Chapter 1. Admin Guide 3.1. interval (int) 3.2. items (int) + 3.3. track (str) 4. RPC Commands @@ -83,6 +86,7 @@ Chapter 1. Admin Guide 3.1. interval (int) 3.2. items (int) + 3.3. track (str) 3.1. interval (int) @@ -106,6 +110,27 @@ modparam("statsc", "interval", 300) modparam("statsc", "items", 200) ... +3.3. track (str) + + Specify the statistics to track. The parameter can be set many times + and one value can speficy many statistics. + + The format is "rname=sname", where the rname is the name for report and + sname is internal Kamailio statistic name. + + Next statistics are tracked by default: + * shm.free - the internal statistc 'free_size' (from group 'shmem'). + * shm.used - the internal statistc 'used_size' (from group 'shmem'). + * shm.real_used - the internal statistc 'real_used_size' (from group + 'shmem'). + + Default value is "". + + Example 1.3. Set track parameter +... +modparam("statsc", "track", "req.received=rcv_requests") +... + 4. RPC Commands 4.1. statsc.exec @@ -114,10 +139,10 @@ modparam("statsc", "items", 200) Get the report of recorded statistics. - Name: statsc.exec + Name: statsc.report Parameters: - * _report_ : + * _type_ : + "list": list recorded values + "diff": show diff between recorded values * _name_: (optional) name of the statistic to show the report for. If @@ -127,8 +152,8 @@ modparam("statsc", "items", 200) Example: ... -# prototype: kamcmd statsc.exec _report_ _name_ _limit_ -kamcmd statsc list -kamcmd statsc list all 10 -kamcmd statsc diff +# prototype: kamcmd statsc.report _type_ _name_ _limit_ +kamcmd statsc.report list +kamcmd statsc.report list all 10 +kamcmd statsc.report diff ...
8 years, 11 months
1
0
0
0
git:master:ce027b03: statsc: documented statistics tracking
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: ce027b038a925fcdad8ec31c18c4432ffc7fca43 URL:
https://github.com/kamailio/kamailio/commit/ce027b038a925fcdad8ec31c18c4432…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-01-22T19:29:58+01:00 statsc: documented statistics tracking --- Modified: modules/statsc/doc/statsc_admin.xml --- Diff:
https://github.com/kamailio/kamailio/commit/ce027b038a925fcdad8ec31c18c4432…
Patch:
https://github.com/kamailio/kamailio/commit/ce027b038a925fcdad8ec31c18c4432…
--- diff --git a/modules/statsc/doc/statsc_admin.xml b/modules/statsc/doc/statsc_admin.xml index cc2d4d9..70124cc 100644 --- a/modules/statsc/doc/statsc_admin.xml +++ b/modules/statsc/doc/statsc_admin.xml @@ -95,6 +95,56 @@ modparam("statsc", "items", 200) </programlisting> </example> </section> + <section id="statsc.p.track"> + <title><varname>track</varname> (str)</title> + <para> + Specify the statistics to track. The parameter can + be set many times and one value can speficy many + statistics. + </para> + <para> + The format is "rname=sname", where the rname is the + name for report and sname is internal &kamailio; statistic + name. + </para> + <para> + Next statistics are tracked by default: + <itemizedlist> + <listitem> + <para> + <emphasis>shm.free</emphasis> - the internal statistc 'free_size' + (from group 'shmem'). + </para> + </listitem> + <listitem> + <para> + <emphasis>shm.used</emphasis> - the internal statistc 'used_size' + (from group 'shmem'). + </para> + </listitem> + <listitem> + <para> + <emphasis>shm.real_used</emphasis> - the internal statistc 'real_used_size' + (from group 'shmem'). + </para> + </listitem> + </itemizedlist> + </para> + <para> + <emphasis> + Default value is "". + </emphasis> + </para> + <example> + <title>Set <varname>track</varname> parameter</title> + <programlisting format="linespecific"> +... +modparam("statsc", "track", "req.received=rcv_requests") +modparam("statsc", "track", "req.received=rcv_requests;rpl.received=rcv_replies") +... +</programlisting> + </example> + </section> </section> <section>
8 years, 11 months
1
0
0
0
git:master:be967617: statsc: documentation of rpc statsc.report
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: be96761756daa73e7af2b7a7a6fd53ec77a7dee0 URL:
https://github.com/kamailio/kamailio/commit/be96761756daa73e7af2b7a7a6fd53e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-01-22T19:29:58+01:00 statsc: documentation of rpc statsc.report --- Modified: modules/statsc/doc/statsc_admin.xml --- Diff:
https://github.com/kamailio/kamailio/commit/be96761756daa73e7af2b7a7a6fd53e…
Patch:
https://github.com/kamailio/kamailio/commit/be96761756daa73e7af2b7a7a6fd53e…
--- diff --git a/modules/statsc/doc/statsc_admin.xml b/modules/statsc/doc/statsc_admin.xml index 7b785a8..cc2d4d9 100644 --- a/modules/statsc/doc/statsc_admin.xml +++ b/modules/statsc/doc/statsc_admin.xml @@ -107,11 +107,11 @@ modparam("statsc", "items", 200) Get the report of recorded statistics. </para> <para> - Name: <emphasis>statsc.exec</emphasis> + Name: <emphasis>statsc.report</emphasis> </para> <para>Parameters:</para> <itemizedlist> - <listitem><para>_report_ : </para> + <listitem><para>_type_ : </para> <itemizedlist> <listitem><para> <quote>list</quote>: list recorded values</para></listitem> <listitem><para> <quote>diff</quote>: show diff between recorded values</para></listitem> @@ -128,10 +128,10 @@ modparam("statsc", "items", 200) </para> <programlisting format="linespecific"> ... -# prototype: &kamcmd; statsc.exec _report_ _name_ _limit_ -&kamcmd; statsc list -&kamcmd; statsc list all 10 -&kamcmd; statsc diff +# prototype: &kamcmd; statsc.report _type_ _name_ _limit_ +&kamcmd; statsc.report list +&kamcmd; statsc.report list all 10 +&kamcmd; statsc.report diff ... </programlisting> </section>
8 years, 11 months
1
0
0
0
git:master:9bd5d2da: stats: rpc command renamed to statsc.report
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 9bd5d2da7f92f0a45962b5adfce56d02defdecbd URL:
https://github.com/kamailio/kamailio/commit/9bd5d2da7f92f0a45962b5adfce56d0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-01-22T19:29:58+01:00 stats: rpc command renamed to statsc.report --- Modified: modules/statsc/statsc_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/9bd5d2da7f92f0a45962b5adfce56d0…
Patch:
https://github.com/kamailio/kamailio/commit/9bd5d2da7f92f0a45962b5adfce56d0…
--- diff --git a/modules/statsc/statsc_mod.c b/modules/statsc/statsc_mod.c index f9ee2fa..d746e1a 100644 --- a/modules/statsc/statsc_mod.c +++ b/modules/statsc/statsc_mod.c @@ -304,7 +304,7 @@ int statsc_track_param(modparam_t type, void* val) /** * */ -static const char* statsc_rpc_exec_doc[2] = { +static const char* statsc_rpc_report_doc[2] = { "Statistics collector control command", 0 }; @@ -312,7 +312,7 @@ static const char* statsc_rpc_exec_doc[2] = { /** * */ -static void statsc_rpc_exec(rpc_t* rpc, void* ctx) +static void statsc_rpc_report(rpc_t* rpc, void* ctx) { statsc_nmap_t *sm = NULL; str cname; @@ -458,7 +458,7 @@ static void statsc_rpc_exec(rpc_t* rpc, void* ctx) * */ rpc_export_t statsc_rpc[] = { - {"statsc.exec", statsc_rpc_exec, statsc_rpc_exec_doc, 0}, + {"statsc.report", statsc_rpc_report, statsc_rpc_report_doc, 0}, {0, 0, 0, 0} }; @@ -467,8 +467,7 @@ rpc_export_t statsc_rpc[] = { */ int statsc_init_rpc(void) { - if (rpc_register_array(statsc_rpc)!=0) - { + if (rpc_register_array(statsc_rpc)!=0) { LM_ERR("failed to register RPC commands\n"); return -1; }
8 years, 11 months
1
0
0
0
git:master:59ff0a65: statsc: allow adding new statistics to trac via config parameters
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 59ff0a65ca840705429debc0477c1c2f0a732f35 URL:
https://github.com/kamailio/kamailio/commit/59ff0a65ca840705429debc0477c1c2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-01-22T19:29:58+01:00 statsc: allow adding new statistics to trac via config parameters --- Modified: modules/statsc/statsc_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/59ff0a65ca840705429debc0477c1c2…
Patch:
https://github.com/kamailio/kamailio/commit/59ff0a65ca840705429debc0477c1c2…
8 years, 11 months
1
0
0
0
git:master:7d810278: statsc: fix compiler warnings: [-Wformat=] and [-Wunused-but-set-variable]
by root
Module: kamailio Branch: master Commit: 7d810278ddca5671235672c85eb4da3520b02d2e URL:
https://github.com/kamailio/kamailio/commit/7d810278ddca5671235672c85eb4da3…
Author: root <root(a)sbc001.mob1.jmfnetworks.net> Committer: root <root(a)sbc001.mob1.jmfnetworks.net> Date: 2016-01-22T11:26:04-06:00 statsc: fix compiler warnings: [-Wformat=] and [-Wunused-but-set-variable] --- Modified: modules/statsc/statsc_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/7d810278ddca5671235672c85eb4da3…
Patch:
https://github.com/kamailio/kamailio/commit/7d810278ddca5671235672c85eb4da3…
--- diff --git a/modules/statsc/statsc_mod.c b/modules/statsc/statsc_mod.c index 8e15499..74ee5fe 100644 --- a/modules/statsc/statsc_mod.c +++ b/modules/statsc/statsc_mod.c @@ -244,7 +244,7 @@ void statsc_timer(unsigned int ticks, void *param) _statsc_info->stable[0][n] = (int64_t)tn; LM_DBG("statsc timer - time: %lu - ticks: %u - index: %d - steps: %llu\n", - (unsigned long)tn, ticks, n, _statsc_info->steps); + (unsigned long)tn, ticks, n, (unsigned long long)_statsc_info->steps); for(i=1; i<_statsc_info->slots; i++) { _statsc_nmap[i].f(_statsc_nmap[i].p, _statsc_info->stable[i] + n); @@ -271,7 +271,7 @@ static void statsc_rpc_exec(rpc_t* rpc, void* ctx) str sname; int range; int sidx; - int i, k, n, r, m, v; + int i, k, n, m, v; time_t tn; void* th; void* ts; @@ -345,7 +345,6 @@ static void statsc_rpc_exec(rpc_t* rpc, void* ctx) return; } m = 0; - r = range; for(k=n; k>=0; k--) { if(rpc->array_add(td, "{", &ti)<0) { rpc->fault(ctx, 500, "Error creating rpc (5)");
8 years, 11 months
1
0
0
0
git:4.3:83e842d6: dtrie: sanity checks
by Stefan Mititelu
Module: kamailio Branch: 4.3 Commit: 83e842d64ee7c0726059d92fc78bdbfa10b2d117 URL:
https://github.com/kamailio/kamailio/commit/83e842d64ee7c0726059d92fc78bdbf…
Author: Stefan Mititelu <stefan.mititelu(a)1and1.ro> Committer: Stefan Mititelu <stefan.mititelu(a)1and1.ro> Date: 2016-01-22T16:53:03+02:00 dtrie: sanity checks Segfaults reported by Igor, on sr-Users mailing list. (cherry picked from commit 825b4fabb9bb4b2cf58dc1205423b8ce5d5e08cc) --- Modified: lib/trie/dtrie.c --- Diff:
https://github.com/kamailio/kamailio/commit/83e842d64ee7c0726059d92fc78bdbf…
Patch:
https://github.com/kamailio/kamailio/commit/83e842d64ee7c0726059d92fc78bdbf…
--- diff --git a/lib/trie/dtrie.c b/lib/trie/dtrie.c index 2883829..f0b2655 100644 --- a/lib/trie/dtrie.c +++ b/lib/trie/dtrie.c @@ -76,7 +76,9 @@ void dtrie_delete(struct dtrie_node_t *root, struct dtrie_node_t *node, dt_delete_func_t delete_payload, const unsigned int branches) { unsigned int i; - if (node==NULL) return; + + if (node == NULL) return; + if (root == NULL) return; for (i=0; i<branches; i++) { dtrie_delete(root, node->child[i], delete_payload, branches); @@ -123,6 +125,10 @@ int dtrie_insert(struct dtrie_node_t *root, const char *number, const unsigned i struct dtrie_node_t *node = root; unsigned char digit, i=0; + if (node == NULL) return -1; + if (root == NULL) return -1; + if (number == NULL) return -1; + while (i<numberlen) { if (branches==10) { digit = number[i] - '0'; @@ -202,6 +208,8 @@ unsigned int dtrie_leaves(const struct dtrie_node_t *root, const unsigned int br { unsigned int i, sum = 0, leaf = 1; + if (root == NULL) return 0; + for (i=0; i<branches; i++) { if (root->child[i]) { sum += dtrie_leaves(root->child[i], branches); @@ -220,6 +228,10 @@ void **dtrie_longest_match(struct dtrie_node_t *root, const char *number, unsigned char digit, i = 0; void **ret = NULL; + if (node == NULL) return NULL; + if (root == NULL) return NULL; + if (number == NULL) return NULL; + if (nmatchptr) *nmatchptr=-1; if (node->data != NULL) { if (nmatchptr) *nmatchptr=0;
8 years, 11 months
1
0
0
0
git:4.2:f5f29ee2: dtrie: sanity checks
by Stefan Mititelu
Module: kamailio Branch: 4.2 Commit: f5f29ee2e89f1b0662785db0fb09ec34364ed9d7 URL:
https://github.com/kamailio/kamailio/commit/f5f29ee2e89f1b0662785db0fb09ec3…
Author: Stefan Mititelu <stefan.mititelu(a)1and1.ro> Committer: Stefan Mititelu <stefan.mititelu(a)1and1.ro> Date: 2016-01-22T16:52:34+02:00 dtrie: sanity checks Segfaults reported by Igor, on sr-Users mailing list. (cherry picked from commit 825b4fabb9bb4b2cf58dc1205423b8ce5d5e08cc) --- Modified: lib/trie/dtrie.c --- Diff:
https://github.com/kamailio/kamailio/commit/f5f29ee2e89f1b0662785db0fb09ec3…
Patch:
https://github.com/kamailio/kamailio/commit/f5f29ee2e89f1b0662785db0fb09ec3…
--- diff --git a/lib/trie/dtrie.c b/lib/trie/dtrie.c index 2883829..f0b2655 100644 --- a/lib/trie/dtrie.c +++ b/lib/trie/dtrie.c @@ -76,7 +76,9 @@ void dtrie_delete(struct dtrie_node_t *root, struct dtrie_node_t *node, dt_delete_func_t delete_payload, const unsigned int branches) { unsigned int i; - if (node==NULL) return; + + if (node == NULL) return; + if (root == NULL) return; for (i=0; i<branches; i++) { dtrie_delete(root, node->child[i], delete_payload, branches); @@ -123,6 +125,10 @@ int dtrie_insert(struct dtrie_node_t *root, const char *number, const unsigned i struct dtrie_node_t *node = root; unsigned char digit, i=0; + if (node == NULL) return -1; + if (root == NULL) return -1; + if (number == NULL) return -1; + while (i<numberlen) { if (branches==10) { digit = number[i] - '0'; @@ -202,6 +208,8 @@ unsigned int dtrie_leaves(const struct dtrie_node_t *root, const unsigned int br { unsigned int i, sum = 0, leaf = 1; + if (root == NULL) return 0; + for (i=0; i<branches; i++) { if (root->child[i]) { sum += dtrie_leaves(root->child[i], branches); @@ -220,6 +228,10 @@ void **dtrie_longest_match(struct dtrie_node_t *root, const char *number, unsigned char digit, i = 0; void **ret = NULL; + if (node == NULL) return NULL; + if (root == NULL) return NULL; + if (number == NULL) return NULL; + if (nmatchptr) *nmatchptr=-1; if (node->data != NULL) { if (nmatchptr) *nmatchptr=0;
8 years, 11 months
1
0
0
0
git:4.1:804b7f19: dtrie: sanity checks
by Stefan Mititelu
Module: kamailio Branch: 4.1 Commit: 804b7f19dc1b95f9226711125d0239574f0aa0a9 URL:
https://github.com/kamailio/kamailio/commit/804b7f19dc1b95f9226711125d02395…
Author: Stefan Mititelu <stefan.mititelu(a)1and1.ro> Committer: Stefan Mititelu <stefan.mititelu(a)1and1.ro> Date: 2016-01-22T16:50:57+02:00 dtrie: sanity checks Segfaults reported by Igor, on sr-Users mailing list. (cherry picked from commit 825b4fabb9bb4b2cf58dc1205423b8ce5d5e08cc) --- Modified: lib/trie/dtrie.c --- Diff:
https://github.com/kamailio/kamailio/commit/804b7f19dc1b95f9226711125d02395…
Patch:
https://github.com/kamailio/kamailio/commit/804b7f19dc1b95f9226711125d02395…
--- diff --git a/lib/trie/dtrie.c b/lib/trie/dtrie.c index 783f6e7..abdd589 100644 --- a/lib/trie/dtrie.c +++ b/lib/trie/dtrie.c @@ -76,7 +76,9 @@ void dtrie_delete(struct dtrie_node_t *root, struct dtrie_node_t *node, dt_delete_func_t delete_payload, const unsigned int branches) { unsigned int i; - if (node==NULL) return; + + if (node == NULL) return; + if (root == NULL) return; for (i=0; i<branches; i++) { dtrie_delete(root, node->child[i], delete_payload, branches); @@ -123,6 +125,10 @@ int dtrie_insert(struct dtrie_node_t *root, const char *number, const unsigned i struct dtrie_node_t *node = root; unsigned char digit, i=0; + if (node == NULL) return -1; + if (root == NULL) return -1; + if (number == NULL) return -1; + while (i<numberlen) { if (branches==10) { digit = number[i] - '0'; @@ -202,6 +208,8 @@ unsigned int dtrie_leaves(const struct dtrie_node_t *root, const unsigned int br { unsigned int i, sum = 0, leaf = 1; + if (root == NULL) return 0; + for (i=0; i<branches; i++) { if (root->child[i]) { sum += dtrie_leaves(root->child[i], branches); @@ -220,6 +228,10 @@ void **dtrie_longest_match(struct dtrie_node_t *root, const char *number, unsigned char digit, i = 0; void **ret = NULL; + if (node == NULL) return NULL; + if (root == NULL) return NULL; + if (number == NULL) return NULL; + if (nmatchptr) *nmatchptr=-1; if (node->data != NULL) { if (nmatchptr) *nmatchptr=0;
8 years, 11 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
30
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
Results per page:
10
25
50
100
200