Module: kamailio
Branch: master
Commit: d7466474bdc86b2b0d0872c5fd41d743ec1c7d66
URL: https://github.com/kamailio/kamailio/commit/d7466474bdc86b2b0d0872c5fd41d74…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-07-11T15:44:07+02:00
core: counters - init local global variables
---
Modified: src/core/counters.c
---
Diff: https://github.com/kamailio/kamailio/commit/d7466474bdc86b2b0d0872c5fd41d74…
Patch: https://github.com/kamailio/kamailio/commit/d7466474bdc86b2b0d0872c5fd41d74…
---
diff --git a/src/core/counters.c b/src/core/counters.c
index 1a7d6637c17..5d9f26e5bce 100644
--- a/src/core/counters.c
+++ b/src/core/counters.c
@@ -70,22 +70,22 @@ struct grp_record
/** hash table mapping a counter name to an id */
static struct str_hash_table cnts_hash_table;
/** array mapping id 2 record */
-struct counter_record **cnt_id2record;
-static int cnt_id2record_size;
+struct counter_record **cnt_id2record = NULL;
+static int cnt_id2record_size = 0;
/** hash table for groups (maps a group name to a counter list) */
static struct str_hash_table grp_hash_table;
/** array of groups, sorted */
-static struct grp_record **grp_sorted;
-static int grp_sorted_max_size;
-static int grp_sorted_crt_size;
-static int grp_no; /* number of groups */
+static struct grp_record **grp_sorted = NULL;
+static int grp_sorted_max_size = 0;
+static int grp_sorted_crt_size = 0;
+static int grp_no = 0; /* number of groups */
/** counters array. a[proc_no][counter_id] =>
_cnst_vals[proc_no*cnts_no+counter_id] */
counter_array_t *_cnts_vals = 0;
-int _cnts_row_len; /* number of elements per row */
-static int cnts_no; /* number of registered counters */
-static int cnts_max_rows; /* set to 0 if not yet fully init */
+int _cnts_row_len = 0; /* number of elements per row */
+static int cnts_no = 0; /* number of registered counters */
+static int cnts_max_rows = 0; /* set to 0 if not yet fully init */
char *ksr_stats_namesep = KSR_STATS_NAMESEP;
Module: kamailio
Branch: master
Commit: fffe7aaecc41b8986eae342ce693bde87cdc20bc
URL: https://github.com/kamailio/kamailio/commit/fffe7aaecc41b8986eae342ce693bde…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-07-11T15:50:48+02:00
core: counters - declare global cnts_no as unsigned short
- it is used for counters h.id which is unsigned short
---
Modified: src/core/counters.c
---
Diff: https://github.com/kamailio/kamailio/commit/fffe7aaecc41b8986eae342ce693bde…
Patch: https://github.com/kamailio/kamailio/commit/fffe7aaecc41b8986eae342ce693bde…
---
diff --git a/src/core/counters.c b/src/core/counters.c
index 5d9f26e5bce..dcf7ab7895e 100644
--- a/src/core/counters.c
+++ b/src/core/counters.c
@@ -83,9 +83,9 @@ static int grp_no = 0; /* number of groups */
/** counters array. a[proc_no][counter_id] =>
_cnst_vals[proc_no*cnts_no+counter_id] */
counter_array_t *_cnts_vals = 0;
-int _cnts_row_len = 0; /* number of elements per row */
-static int cnts_no = 0; /* number of registered counters */
-static int cnts_max_rows = 0; /* set to 0 if not yet fully init */
+int _cnts_row_len = 0; /* number of elements per row */
+static unsigned short cnts_no = 0; /* number of registered counters */
+static int cnts_max_rows = 0; /* set to 0 if not yet fully init */
char *ksr_stats_namesep = KSR_STATS_NAMESEP;
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Improved URN parsing according to [RFC8141](https://datatracker.ietf.org/doc/html/rfc8141#section-2) that allows an arbitrary number of colons to be present in the URN value. Entire URN NID and NSS parts (except for `urn:` scheme) are stored in the `uri.host` struct field. `rq-components` are not supported.
Example of the parse error when parsing "urn:emergency:service:sos"
```
parse_uri(): bad char ':' in state 3 parsed: urn:emergency:service (21) / urn:emergency:service:sos (25)
```
URN values that have been tested to work:
- `urn:emergency:service:sos`
- `urn:emergency:responder.fire`
- `urn:emergency:media-feature`
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3909
-- Commit Summary --
* core: Improved URN parsing according to RFC8141
-- File Changes --
M src/core/parser/parse_uri.c (48)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3909.patchhttps://github.com/kamailio/kamailio/pull/3909.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3909
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3909(a)github.com>