Module: kamailio
Branch: master
Commit: 4780d46976a7a392f23af0d89f05855d473bcb30
URL: https://github.com/kamailio/kamailio/commit/4780d46976a7a392f23af0d89f05855…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-05-09T09:05:18+02:00
usrloc: connect to db for main process in PROC_POSTCHILDINIT child init
---
Modified: src/modules/usrloc/usrloc_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/4780d46976a7a392f23af0d89f05855…
Patch: https://github.com/kamailio/kamailio/commit/4780d46976a7a392f23af0d89f05855…
---
diff --git a/src/modules/usrloc/usrloc_mod.c b/src/modules/usrloc/usrloc_mod.c
index d60162ed3e..797c252b85 100644
--- a/src/modules/usrloc/usrloc_mod.c
+++ b/src/modules/usrloc/usrloc_mod.c
@@ -358,6 +358,16 @@ static int mod_init(void)
}
/* Shall we use database ? */
+ switch (ul_db_mode) {
+ case DB_ONLY:
+ case WRITE_THROUGH:
+ case WRITE_BACK:
+ /*
+ * register the need to be called post-fork of all children
+ * with the special rank PROC_POSTCHILDINIT
+ */
+ ksr_module_set_flag(KSRMOD_FLAG_POSTCHILDINIT);
+ }
if (ul_db_mode != NO_DB) { /* Yes */
if (db_bind_mod(&ul_db_url, &ul_dbf) < 0) { /* Find database module */
LM_ERR("failed to bind database module\n");
@@ -452,14 +462,14 @@ static int child_init(int _rank)
case WRITE_THROUGH:
/* connect to db only from SIP workers, TIMER and MAIN processes,
* and RPC processes */
- if (_rank<=0 && _rank!=PROC_TIMER && _rank!=PROC_MAIN
+ if (_rank<=0 && _rank!=PROC_TIMER && _rank!=PROC_POSTCHILDINIT
&& _rank!=PROC_RPC)
return 0;
break;
case WRITE_BACK:
/* connect to db only from TIMER (for flush), from MAIN (for
* final flush() and from child 1 for preload */
- if (_rank!=PROC_TIMER && _rank!=PROC_MAIN && _rank!=PROC_SIPINIT)
+ if (_rank!=PROC_TIMER && _rank!=PROC_POSTCHILDINIT && _rank!=PROC_SIPINIT)
return 0;
break;
case DB_READONLY:
Module: kamailio
Branch: master
Commit: a21c929a389c6e5f85e9166d01adb0d474c6ebaf
URL: https://github.com/kamailio/kamailio/commit/a21c929a389c6e5f85e9166d01adb0d…
Author: Henning Westerholt <hw(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2022-05-08T15:33:56Z
userblocklist: fix function comment, related to gh #3102
---
Modified: src/modules/userblocklist/db_userblocklist.c
---
Diff: https://github.com/kamailio/kamailio/commit/a21c929a389c6e5f85e9166d01adb0d…
Patch: https://github.com/kamailio/kamailio/commit/a21c929a389c6e5f85e9166d01adb0d…
---
diff --git a/src/modules/userblocklist/db_userblocklist.c b/src/modules/userblocklist/db_userblocklist.c
index e857178f25..0377761ab3 100644
--- a/src/modules/userblocklist/db_userblocklist.c
+++ b/src/modules/userblocklist/db_userblocklist.c
@@ -61,7 +61,7 @@ void userblocklist_db_close(void) {
/*!
- * Initialises the DB API, check the table version and closes the connection.
+ * Initialises the DB API and check the table version.
* This should be called from the mod_init function.
*
* \return 0 means ok, -1 means an error occurred.
<!-- 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 -->
Spotted this ERRORs on kamailio restart:
```
ERROR: <core> [db.c:481]: db_use_table(): invalid connection parameter
ERROR: userblocklist [db.c:123]: db_reload_source(): cannot use db table 'globalblocklist'
ERROR: userblocklist [userblocklist.c:425]: load_source(): cannot load source from 'globalblocklist
```
Debugging it further, seen that the above ERRORs appear on ```check_allowlist()``` function fixup. This was happening because db connection is closed in mod_init and re-done in child_init. But the fixups happen before child_init and they need db connection.
Decided to not close the db connection after mod_init because they are later, first closed and then re-opened, in each child. Figured out this fix after checked where each function of db_userblocklist.c is used.
ERRORs no longer appear on restart.
Thank you,
Stefan
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3102
-- Commit Summary --
* userblocklist: fix restart errors
-- File Changes --
M src/modules/userblocklist/db_userblocklist.c (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3102.patchhttps://github.com/kamailio/kamailio/pull/3102.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3102
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3102(a)github.com>
Module: kamailio
Branch: master
Commit: 97efd6a64380025f3b4ef45372180f7e61448c1c
URL: https://github.com/kamailio/kamailio/commit/97efd6a64380025f3b4ef45372180f7…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2022-05-08T17:31:17+02:00
modules: readme files regenerated - acc ... [skip ci]
---
Modified: src/modules/acc/README
Modified: src/modules/ldap/README
---
Diff: https://github.com/kamailio/kamailio/commit/97efd6a64380025f3b4ef45372180f7…
Patch: https://github.com/kamailio/kamailio/commit/97efd6a64380025f3b4ef45372180f7…
---
diff --git a/src/modules/acc/README b/src/modules/acc/README
index 7c31188ac7..878623d24f 100644
--- a/src/modules/acc/README
+++ b/src/modules/acc/README
@@ -1129,7 +1129,7 @@ modparam("acc", "cdr_start_on_confirmed", 1)
6.34. cdr_facility (integer)
Log facility to which CDR messages are issued to syslog. This allows to
- easily seperate CDR-specific logging from the other log messages.
+ easily separate CDR-specific logging from the other log messages.
Default value is LOG_DAEMON.
diff --git a/src/modules/ldap/README b/src/modules/ldap/README
index c7555ca3c6..921f45822f 100644
--- a/src/modules/ldap/README
+++ b/src/modules/ldap/README
@@ -533,7 +533,7 @@ ldap_result("telephoneNumber/$avp(s:tel_number)");
AVP. It can be either str for string, or int for integer. If avp_type
is specified as int then ldap_result tries to convert the LDAP
attribute values to integer. In this case, the values are only stored
- as AVP if the conversion to integer is succesfull.
+ as AVP if the conversion to integer is successful.
Function Parameters:
<!-- 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
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Fix typos.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3103
-- Commit Summary --
* doc: Fix typos
* pkg: Fix typos
* core: Fix typos
* lib: Fix typos
* acc: Fix typos
* auth: Fix typos
* ctl: Fix typos
* ldap: Fix typos
* pike: Fix typos
* sanity: Fix typos
* tls: Fix typos
* uid_auth_db: Fix typos
* utils: Fix typos
-- File Changes --
M doc/misc/NEWS (2)
M doc/tutorials/locking.txt (4)
M pkg/kamailio/deb/bionic/rules (2)
M pkg/kamailio/deb/bookworm/rules (2)
M pkg/kamailio/deb/bullseye/rules (2)
M pkg/kamailio/deb/buster/rules (2)
M pkg/kamailio/deb/debian/rules (2)
M pkg/kamailio/deb/focal/rules (2)
M pkg/kamailio/deb/jessie/rules (2)
M pkg/kamailio/deb/precise/rules (2)
M pkg/kamailio/deb/sid/rules (2)
M pkg/kamailio/deb/stretch/rules (2)
M pkg/kamailio/deb/trusty/rules (2)
M pkg/kamailio/deb/wheezy/rules (2)
M pkg/kamailio/deb/xenial/rules (2)
M src/core/atomic/atomic_mips2.h (2)
M src/core/dns_cache.c (4)
M src/core/forward.c (2)
M src/core/resolve.c (4)
M src/core/tcp_main.c (10)
M src/lib/cds/dstring.h (2)
M src/lib/srdb1/schema/uid_credentials.xml (2)
M src/lib/srdb2/db_cmd.c (4)
M src/lib/srdb2/schema/credentials.xml (2)
M src/modules/acc/doc/acc_admin.xml (2)
M src/modules/auth/challenge.c (2)
M src/modules/auth/nonce.c (12)
M src/modules/ctl/binrpc.h (4)
M src/modules/ldap/doc/ldap_admin.xml (2)
M src/modules/pike/ip_tree.c (2)
M src/modules/sanity/sanity.c (2)
M src/modules/sanity/sanity.h (2)
M src/modules/tls/tls_server.c (2)
M src/modules/uid_auth_db/authorize.c (2)
M utils/kamctl/kamdbctl.pgsql (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3103.patchhttps://github.com/kamailio/kamailio/pull/3103.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3103
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3103(a)github.com>
Module: kamailio
Branch: master
Commit: f72c574372abf4c0286799137896a247ed6269b6
URL: https://github.com/kamailio/kamailio/commit/f72c574372abf4c0286799137896a24…
Author: Bastian Triller <bastian.triller(a)gmail.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2022-05-08T17:30:14+02:00
uid_auth_db: Fix typos
---
Modified: src/modules/uid_auth_db/authorize.c
---
Diff: https://github.com/kamailio/kamailio/commit/f72c574372abf4c0286799137896a24…
Patch: https://github.com/kamailio/kamailio/commit/f72c574372abf4c0286799137896a24…
---
diff --git a/src/modules/uid_auth_db/authorize.c b/src/modules/uid_auth_db/authorize.c
index 0dd155adda..a71fd45793 100644
--- a/src/modules/uid_auth_db/authorize.c
+++ b/src/modules/uid_auth_db/authorize.c
@@ -216,7 +216,7 @@ static int generate_avps(db_res_t* result, db_rec_t *row)
/* this is a dirty work around to check the credentials of all users,
* if the database query returned more then one result
*
- * Fills res (which must be db_free'd afterwards if the call was succesfull)
+ * Fills res (which must be db_free'd afterwards if the call was successful)
* returns 0 on success, 1 on no match (?)
* and -1 on error (memory, db a.s.o).
* WARNING: if -1 is returned res _must_ _not_ be freed (it's empty)