[sr-dev] git:master:83966b2a: sqlops: fix reversed logic in db re-connecting handling (GH #1821)

Henning Westerholt hw at skalatan.de
Fri Apr 5 11:10:01 CEST 2019


Module: kamailio
Branch: master
Commit: 83966b2aaee656c0b18098f7e477190a8cb32c5c
URL: https://github.com/kamailio/kamailio/commit/83966b2aaee656c0b18098f7e477190a8cb32c5c

Author: Henning Westerholt <hw at skalatan.de>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2019-04-05T11:03:51+02:00

sqlops: fix reversed logic in db re-connecting handling (GH #1821)

---

Modified: src/modules/sqlops/sql_api.c

---

Diff:  https://github.com/kamailio/kamailio/commit/83966b2aaee656c0b18098f7e477190a8cb32c5c.diff
Patch: https://github.com/kamailio/kamailio/commit/83966b2aaee656c0b18098f7e477190a8cb32c5c.patch

---

diff --git a/src/modules/sqlops/sql_api.c b/src/modules/sqlops/sql_api.c
index 87c4f2f229..f39da7fed8 100644
--- a/src/modules/sqlops/sql_api.c
+++ b/src/modules/sqlops/sql_api.c
@@ -161,7 +161,7 @@ int sql_connect(int mode)
 		sc->dbh = sc->dbf.init(&sc->db_url);
 		if (sc->dbh==NULL)
 		{
-			if(mode) {
+			if(!mode) {
 				LM_ERR("failed to connect to the database [%.*s]\n",
 						sc->name.len, sc->name.s);
 				return -1;




More information about the sr-dev mailing list