Module: sip-router
Branch: master
Commit: 9ef3e0e6ae997b31cb66310c3aaf4e4970699760
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9ef3e0e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Apr 11 11:03:50 2012 +0200
db_cluster: fixed the return of a valid connection
- a condition was not properly inverted in a previous commit
- reported by Juha Heinanen
---
modules_k/db_cluster/dbcl_api.c | 4 ++++
modules_k/db_cluster/dbcl_data.c | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/modules_k/db_cluster/dbcl_api.c b/modules_k/db_cluster/dbcl_api.c
index a081009..d92a8ca 100644
--- a/modules_k/db_cluster/dbcl_api.c
+++ b/modules_k/db_cluster/dbcl_api.c
@@ -105,6 +105,8 @@
return -1;\
}\
}\
+ LM_DBG("no successful read on cluster [%.*s]\n",\
+ cls->name.len, cls->name.s);\
return ret;\
} while(0)
@@ -204,6 +206,8 @@
return -1;\
}\
}\
+ LM_DBG("no successful write on cluster [%.*s]\n",\
+ cls->name.len, cls->name.s);\
return ret;\
} while(0)
diff --git a/modules_k/db_cluster/dbcl_data.c b/modules_k/db_cluster/dbcl_data.c
index 9533421..d961d01 100644
--- a/modules_k/db_cluster/dbcl_data.c
+++ b/modules_k/db_cluster/dbcl_data.c
@@ -126,7 +126,7 @@ int dbcl_init_con(str *name, str *url)
int dbcl_valid_con(dbcl_con_t *sc)
{
- if(sc==NULL || sc->flags!=0 || sc->dbh!=NULL)
+ if(sc==NULL || sc->flags==0 || sc->dbh==NULL)
return -1;
if(sc->sinfo==NULL)
return 0;