Browse Source

dialog(k): fix db connection conflict after the last backports

- reported by Phillman25 Kyriacou
Daniel-Constantin Mierla 14 years ago
parent
commit
e392a83f76
1 changed files with 3 additions and 4 deletions
  1. 3 4
      modules_k/dialog/dlg_db_handler.c

+ 3 - 4
modules_k/dialog/dlg_db_handler.c

@@ -113,12 +113,11 @@ static int load_dialog_info_from_db(int dlg_hash_size, int fetch_num_rows);
 
 
 int dlg_connect_db(const str *db_url)
 int dlg_connect_db(const str *db_url)
 {
 {
-	if (dialog_db_handle) {
-		LM_CRIT("BUG - db connection found already open\n");
+	dialog_db_handle = dialog_dbf.init(db_url);
+	if(dialog_db_handle == 0) {
+		LM_ERR("unable to connect to database\n");
 		return -1;
 		return -1;
 	}
 	}
-	if ((dialog_db_handle = dialog_dbf.init(db_url)) == 0)
-		return -1;
 	return 0;
 	return 0;
 }
 }