Module: sip-router Branch: master Commit: d593078c2e0bb123d56de2d440473cc12a08fba6 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d593078c...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Wed Aug 31 09:38:28 2011 +0200
usrloc(k): request a db connection per child
- avoid sharing the connection between processes - reported by MÉSZÁROS Mihály
---
modules_k/usrloc/ul_mod.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/modules_k/usrloc/ul_mod.c b/modules_k/usrloc/ul_mod.c index c3fe26a..eaa36e2 100644 --- a/modules_k/usrloc/ul_mod.c +++ b/modules_k/usrloc/ul_mod.c @@ -355,8 +355,7 @@ static int child_init(int _rank) break; }
- if (!ul_dbh) - ul_dbh = ul_dbf.init(&db_url); /* Get a new database connection */ + ul_dbh = ul_dbf.init(&db_url); /* Get a database connection per child */ if (!ul_dbh) { LM_ERR("child(%d): failed to connect to database\n", _rank); return -1; @@ -386,10 +385,6 @@ static int mi_child_init(void) return 0;
if (db_mode != NO_DB) { - if (ul_dbh) { - done = 1; - return 0; - } ul_dbh = ul_dbf.init(&db_url); if (!ul_dbh) { LM_ERR("failed to connect to database\n");