[sr-dev] git:3.1: dialog(k): fix db connection conflict after the last backports

Daniel-Constantin Mierla miconda at gmail.com
Tue Jan 11 17:02:20 CET 2011


Module: sip-router
Branch: 3.1
Commit: cc6858ab7366ae07cd108d40819695f03456669e
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cc6858ab7366ae07cd108d40819695f03456669e

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Jan 11 17:00:38 2011 +0100

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

- reported by Phillman25 Kyriacou
(cherry picked from commit e392a83f7608ae0967d22d23006748fe8f09cabf)

---

 modules_k/dialog/dlg_db_handler.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules_k/dialog/dlg_db_handler.c b/modules_k/dialog/dlg_db_handler.c
index 0a6ab04..86dd074 100644
--- a/modules_k/dialog/dlg_db_handler.c
+++ b/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)
 {
-	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;
 	}
-	if ((dialog_db_handle = dialog_dbf.init(db_url)) == 0)
-		return -1;
 	return 0;
 }
 




More information about the sr-dev mailing list