Module: sip-router
Branch: 3.1
Commit: 26a3bb66c0f0f2c640a536df10f28df1a28a9ccb
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=26a3bb6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sat Jan 15 12:34:11 2011 +0100
dispatcher(k): don't safety check db con in child init
- proper db connection is returned based on pid condition
(cherry picked from commit 0fa5e3acc651c7659fb0d55f03f0d23aade1dad1)
---
modules_k/dispatcher/dispatch.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/modules_k/dispatcher/dispatch.c b/modules_k/dispatcher/dispatch.c
index 231b156..ba123bb 100644
--- a/modules_k/dispatcher/dispatch.c
+++ b/modules_k/dispatcher/dispatch.c
@@ -626,19 +626,13 @@ error:
*/
int ds_connect_db(void)
{
- if(!ds_db_url.s)
+ if(ds_db_url.s==NULL)
return -1;
- if (ds_db_handle)
- {
- LM_CRIT("BUG - db connection found already open\n");
+ if((ds_db_handle = ds_dbf.init(&ds_db_url)) == 0) {
+ LM_ERR("cannot initialize db connection\n");
return -1;
}
-
- if ((ds_db_handle = ds_dbf.init(&ds_db_url)) == 0){
-
- return -1;
- }
return 0;
}