Browse Source

usrloc(k): request a db connection per child

- avoid sharing the connection between processes
- reported by MÉSZÁROS Mihály
Daniel-Constantin Mierla 14 years ago
parent
commit
d593078c2e
1 changed files with 1 additions and 6 deletions
  1. 1 6
      modules_k/usrloc/ul_mod.c

+ 1 - 6
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");