[sr-dev] git:master: dialog(k): open db connection for main process in db delayed mode

Daniel-Constantin Mierla miconda at gmail.com
Sun Jan 2 20:03:33 CET 2011


Module: sip-router
Branch: master
Commit: 7c530f69da7368f87e78d7a3ad1f3439005402a5
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7c530f69da7368f87e78d7a3ad1f3439005402a5

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sun Jan  2 19:56:40 2011 +0100

dialog(k): open db connection for main process in db delayed mode

- used at shutdown to write to db

---

 modules_k/dialog/dialog.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules_k/dialog/dialog.c b/modules_k/dialog/dialog.c
index 8a0963c..9d875b7 100644
--- a/modules_k/dialog/dialog.c
+++ b/modules_k/dialog/dialog.c
@@ -612,9 +612,10 @@ static int child_init(int rank)
 		if_update_stat(dlg_enable_stats, early_dlgs, early_dlgs_cnt);
 	}
 
-	if ( ((dlg_db_mode==DB_MODE_REALTIME || dlg_db_mode==DB_MODE_DELAYED) &&
-	(rank>0 || rank==PROC_TIMER)) ||
-	(dlg_db_mode==DB_MODE_SHUTDOWN && (rank==PROC_MAIN)) ) {
+	if ( ((dlg_db_mode==DB_MODE_REALTIME || dlg_db_mode==DB_MODE_DELAYED)
+				&& (rank>0 || rank==PROC_TIMER || rank==PROC_MAIN))
+			|| (dlg_db_mode==DB_MODE_SHUTDOWN && (rank==PROC_MAIN)) )
+	{
 		if ( dlg_connect_db(&db_url) ) {
 			LM_ERR("failed to connect to database (rank=%d)\n",rank);
 			return -1;




More information about the sr-dev mailing list