andrei 2009/06/11 01:21:27 CEST
SER CVS Repository
Modified files:
. sctp_options.c sctp_options.h
sctp_server.c
Log:
sctp: more config variables
Added more config variables for various sctp protocol specific
parameters:
asocmaxrxt - maximum retransmissions attempts per association
init_max_attempts - maximum INIT retransmission attempts
init_max_timeo - maximum INIT retransmission timeout (RTO max for
INIT)
hbinterval - sctp heartbeat interval, -1 for disable
pathmaxrxt - maximum retransmission attempts per path
sack_delay - delay until an ACK is generated after receiving a
packet.
sack_freq - number of packets received before an ACK is sent
max_burst - maximum burst of packets that can be emitted by an
association
All of them can be changed at runtime (e.g.
$ sercmd cfg.set_now_int sctp hbinterval -1 ), but the changes
will affect only new associations (they will not affect the
already established ones).
Revision Changes Path
1.8 +227 -2 sip_router/sctp_options.c
http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/sctp_options.c.dif…
1.5 +12 -4 sip_router/sctp_options.h
http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/sctp_options.h.dif…
1.28 +192 -1 sip_router/sctp_server.c
http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/sctp_server.c.diff…
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
Daniel-Constantin Mierla has taken ownership of the following task:
FS#3 - msilo m_dump() does not notice de-registration
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=3
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Module: sip-router
Branch: master
Commit: 82a5ef65ffe69b33accecc67b24376307aa46812
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=82a5ef6…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Wed Jun 10 22:41:27 2009 +0200
db: Fixing problem with incorrect initialization of db connections
The sip-router core is based on the ser core and thus has a slightly
different initialization sequence of the main sr process. Namely we
also call the child_init function of all modules in the main process
with rank PROC_INIT. This is a kind of delayed initialization (called
after all mod_init functions have finished but before the main
process started forking children).
There should be no database connections opened in child_init called
with PROC_INIT parameter. This would result in database connections
opened in the main process and inherited by all children. Such
connections could then be used from multiple processes simultaneously
and that can cause race conditions.
This change checks for the value of the rank parameter in child_init
functions and skips database initialization if the value is PROC_INIT,
PROC_MAIN, or PROC_TCP_MAIN.
The problem was reported by Juha and he deserves the credit for helping to
investigate the issue.
---
modules/carrierroute/carrierroute.c | 3 +++
modules/utils/utils.c | 3 +++
modules_k/acc/acc_mod.c | 3 +++
modules_k/alias_db/alias_db.c | 3 +++
modules_k/auth_db/authdb_mod.c | 3 +++
modules_k/avpops/avpops.c | 2 +-
modules_k/cpl-c/cpl.c | 3 +++
modules_k/group/group_mod.c | 3 +++
modules_k/imc/imc.c | 3 +++
modules_k/msilo/msilo.c | 3 +++
modules_k/pdt/pdt.c | 3 +++
modules_k/permissions/trusted.c | 3 +++
modules_k/presence/presence.c | 3 +++
modules_k/presence_xml/presence_xml.c | 3 +++
modules_k/pua/pua.c | 3 +++
modules_k/rls/rls.c | 3 +++
modules_k/siptrace/siptrace.c | 3 +++
modules_k/speeddial/speeddial.c | 3 +++
modules_k/sqlops/sqlops.c | 2 +-
modules_k/uri_db/uridb_mod.c | 3 +++
modules_k/userblacklist/userblacklist.c | 3 +++
modules_k/xcap_client/xcap_client.c | 3 +++
22 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/modules/carrierroute/carrierroute.c b/modules/carrierroute/carrierroute.c
index 4a7c8d0..63d9677 100644
--- a/modules/carrierroute/carrierroute.c
+++ b/modules/carrierroute/carrierroute.c
@@ -229,6 +229,9 @@ static int mod_init(void) {
static int child_init(int rank) {
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
if(mode == CARRIERROUTE_MODE_DB){
return carrierroute_db_open();
}
diff --git a/modules/utils/utils.c b/modules/utils/utils.c
index bb15072..34b70c4 100644
--- a/modules/utils/utils.c
+++ b/modules/utils/utils.c
@@ -280,6 +280,9 @@ static int mod_init(void)
/* Child initialization function */
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
return pres_db_open();
}
diff --git a/modules_k/acc/acc_mod.c b/modules_k/acc/acc_mod.c
index b98bfef..5f25647 100644
--- a/modules_k/acc/acc_mod.c
+++ b/modules_k/acc/acc_mod.c
@@ -527,6 +527,9 @@ static int mod_init( void )
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
#ifdef SQL_ACC
if(db_url.s && acc_db_init_child(&db_url)<0) {
LM_ERR("could not open database connection");
diff --git a/modules_k/alias_db/alias_db.c b/modules_k/alias_db/alias_db.c
index af50987..0606cd9 100644
--- a/modules_k/alias_db/alias_db.c
+++ b/modules_k/alias_db/alias_db.c
@@ -111,6 +111,9 @@ struct module_exports exports = {
*/
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
db_handle = adbf.init(&db_url);
if (!db_handle)
{
diff --git a/modules_k/auth_db/authdb_mod.c b/modules_k/auth_db/authdb_mod.c
index d5daedf..e3df1f5 100644
--- a/modules_k/auth_db/authdb_mod.c
+++ b/modules_k/auth_db/authdb_mod.c
@@ -156,6 +156,9 @@ struct module_exports exports = {
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
auth_db_handle = auth_dbf.init(&db_url);
if (auth_db_handle == 0){
LM_ERR("unable to connect to the database\n");
diff --git a/modules_k/avpops/avpops.c b/modules_k/avpops/avpops.c
index e01fcdf..440c8f6 100644
--- a/modules_k/avpops/avpops.c
+++ b/modules_k/avpops/avpops.c
@@ -201,7 +201,7 @@ static int avpops_child_init(int rank)
if (db_url.s==0)
return 0;
/* skip main process and TCP manager process */
- if (rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
return 0;
/* init DB connection */
return avpops_db_init(&db_url, &db_table, db_columns);
diff --git a/modules_k/cpl-c/cpl.c b/modules_k/cpl-c/cpl.c
index bbd0db8..d23d4f6 100644
--- a/modules_k/cpl-c/cpl.c
+++ b/modules_k/cpl-c/cpl.c
@@ -398,6 +398,9 @@ error:
static int cpl_child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
return cpl_db_init(&db_url, &db_table);
}
diff --git a/modules_k/group/group_mod.c b/modules_k/group/group_mod.c
index ee0a766..b444f5c 100644
--- a/modules_k/group/group_mod.c
+++ b/modules_k/group/group_mod.c
@@ -180,6 +180,9 @@ struct module_exports exports = {
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
return group_db_init(&db_url);
}
diff --git a/modules_k/imc/imc.c b/modules_k/imc/imc.c
index 687733f..dd042de 100644
--- a/modules_k/imc/imc.c
+++ b/modules_k/imc/imc.c
@@ -415,6 +415,9 @@ static int mod_init(void)
*/
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
if (imc_dbf.init==0)
{
LM_ERR("database not bound\n");
diff --git a/modules_k/msilo/msilo.c b/modules_k/msilo/msilo.c
index d17e0d7..72f1164 100644
--- a/modules_k/msilo/msilo.c
+++ b/modules_k/msilo/msilo.c
@@ -441,6 +441,9 @@ static int mod_init(void)
*/
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
LM_DBG("rank #%d / pid <%d>\n", rank, getpid());
if (msilo_dbf.init==0)
{
diff --git a/modules_k/pdt/pdt.c b/modules_k/pdt/pdt.c
index 46d6206..28650d8 100644
--- a/modules_k/pdt/pdt.c
+++ b/modules_k/pdt/pdt.c
@@ -288,6 +288,9 @@ static int child_init(void)
/* each child get a new connection to the database */
static int mod_child_init(int r)
{
+ if (r=PROC_INIT || r==PROC_MAIN || r==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
if ( child_init()!=0 )
return -1;
diff --git a/modules_k/permissions/trusted.c b/modules_k/permissions/trusted.c
index 24327e2..79a2d47 100644
--- a/modules_k/permissions/trusted.c
+++ b/modules_k/permissions/trusted.c
@@ -226,6 +226,9 @@ error:
*/
int init_child_trusted(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
if (!db_url.s) {
return 0;
}
diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c
index 13b74ae..a07cf21 100644
--- a/modules_k/presence/presence.c
+++ b/modules_k/presence/presence.c
@@ -350,6 +350,9 @@ static int mod_init(void)
*/
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
pid = my_pid();
if(library_mode)
diff --git a/modules_k/presence_xml/presence_xml.c b/modules_k/presence_xml/presence_xml.c
index 90d4312..d54e76c 100644
--- a/modules_k/presence_xml/presence_xml.c
+++ b/modules_k/presence_xml/presence_xml.c
@@ -283,6 +283,9 @@ static int child_init(int rank)
{
LM_DBG("[%d] pid [%d]\n", rank, getpid());
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
if (pxml_dbf.init==0)
{
LM_CRIT("database not bound\n");
diff --git a/modules_k/pua/pua.c b/modules_k/pua/pua.c
index 46dadd3..3efaaac 100644
--- a/modules_k/pua/pua.c
+++ b/modules_k/pua/pua.c
@@ -247,6 +247,9 @@ static int mod_init(void)
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
if (pua_dbf.init==0)
{
LM_CRIT("database not bound\n");
diff --git a/modules_k/rls/rls.c b/modules_k/rls/rls.c
index 1f5f9e9..fd9f5da 100644
--- a/modules_k/rls/rls.c
+++ b/modules_k/rls/rls.c
@@ -453,6 +453,9 @@ static int mod_init(void)
*/
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
LM_DBG("child [%d] pid [%d]\n", rank, getpid());
if (rls_dbf.init==0)
{
diff --git a/modules_k/siptrace/siptrace.c b/modules_k/siptrace/siptrace.c
index 421f6b5..cdd3f5c 100644
--- a/modules_k/siptrace/siptrace.c
+++ b/modules_k/siptrace/siptrace.c
@@ -321,6 +321,9 @@ static int mod_init(void)
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
db_con = db_funcs.init(&db_url);
if (!db_con) {
LM_ERR("unable to connect to database. Please check configuration.\n");
diff --git a/modules_k/speeddial/speeddial.c b/modules_k/speeddial/speeddial.c
index e31a7ac..5db4fcb 100644
--- a/modules_k/speeddial/speeddial.c
+++ b/modules_k/speeddial/speeddial.c
@@ -113,6 +113,9 @@ struct module_exports exports = {
*/
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
db_handle = db_funcs.init(&db_url);
if (!db_handle)
{
diff --git a/modules_k/sqlops/sqlops.c b/modules_k/sqlops/sqlops.c
index db56345..b38bbe3 100644
--- a/modules_k/sqlops/sqlops.c
+++ b/modules_k/sqlops/sqlops.c
@@ -89,7 +89,7 @@ struct module_exports exports= {
static int child_init(int rank)
{
- if (rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
return 0;
return sql_connect();
}
diff --git a/modules_k/uri_db/uridb_mod.c b/modules_k/uri_db/uridb_mod.c
index 7206cba..7a9e296 100644
--- a/modules_k/uri_db/uridb_mod.c
+++ b/modules_k/uri_db/uridb_mod.c
@@ -141,6 +141,9 @@ struct module_exports exports = {
*/
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
if (db_url.len)
return uridb_db_init(&db_url);
else
diff --git a/modules_k/userblacklist/userblacklist.c b/modules_k/userblacklist/userblacklist.c
index 0e7365e..5179ee4 100644
--- a/modules_k/userblacklist/userblacklist.c
+++ b/modules_k/userblacklist/userblacklist.c
@@ -567,6 +567,9 @@ static int mod_init(void)
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
if (userblacklist_db_open() != 0) return -1;
dtrie_root=dtrie_init(10);
if (dtrie_root == NULL) {
diff --git a/modules_k/xcap_client/xcap_client.c b/modules_k/xcap_client/xcap_client.c
index dab7ef3..8be0798 100644
--- a/modules_k/xcap_client/xcap_client.c
+++ b/modules_k/xcap_client/xcap_client.c
@@ -169,6 +169,9 @@ static int mod_init(void)
static int child_init(int rank)
{
+ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
+ return 0; /* do nothing for the main process */
+
if((xcap_db = xcap_dbf.init(&xcap_db_url))==NULL)
{
LM_ERR("cannot connect to db\n");
Hello,
I setup a flyspray based bug tracker at http://sip-router.org/tracker
feel free to give it a try. If it works then we can use it, if not then we can
try something else.
For developers: please let me know when you create accounts so that I can give
you admin rights. Also, please, use https://sip-router.org/tracker (SSL
protected) to login and register.
Jan.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has been changed. The changes are listed below. For full information about what has changed, visit the URL and click the History tab.
FS#5 - Compilation on OpenSUSE only is LDAP and H350 modules are removed
User who did this: Edson (egschubert)
Task details edited:
-------
I am testing to compile SR on an OpenSUSE VM machine...
With default Makefile (where ldap is part on the excluded modules), compilation fails, since no LDAP support is _not_ installed.
It only succed if I _remove_ the source code of the modules_k LDAP and H350 (both related to ldap support).
OpenSUSE 11.1
Linux Kamailio-151 2.6.27.21-0.1-pae #1 SMP 2009-03-31 14:50:44 +0200 i686 i686 i386 GNU/Linux
gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291]
GNU Make 3.81
Edson.
-------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=5
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Edson (egschubert)
Attached to Project - sip-router
Summary - Compilation on OpenSUSE only is LDAP and H350 modules are removed
Task Type - Bug Report
Category - Core
Status - New
Assigned To - sip-router admin
Operating System - Linux
Severity - Medium
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - I am testing to compile SR on an OpenSUSE VM machine...
With default Makefile (where ldap is part on the excluded modules), compilation fails, since no LDAP support is installed.
It only succed if I _remove_ the source code of the modules_k LDAP and H350 (both related to ldap support).
OpenSUSE 11.1
Linux Kamailio-151 2.6.27.21-0.1-pae #1 SMP 2009-03-31 14:50:44 +0200 i686 i686 i386 GNU/Linux
gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291]
GNU Make 3.81
Edson.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=5
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Just registered myself on the tracker as 'egschubert', confirmed
subscription, but only able to search/see the task list...
All permissions listed as 'No'. After registration, shouldn't be able
to, at least, "open new tasks"?
Edson.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Jan Janak (janakj)
Attached to Project - sip-router
Summary - Fix "command out of sync" issue in db_mysql
Task Type - Bug Report
Category - Module
Status - Researching
Assigned To - Jan Janak
Operating System - All
Severity - High
Priority - Urgent
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - There is an issue with the database code in the latest sip-router tree, mysql database connections report "command out of sync".
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=4
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.