Module: sip-router
Branch: master
Commit: 0fa5e3acc651c7659fb0d55f03f0d23aade1dad1
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0fa5e3a…
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
---
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 e42f5d8..19b5fab 100644
--- a/modules_k/dispatcher/dispatch.c
+++ b/modules_k/dispatcher/dispatch.c
@@ -627,19 +627,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;
}