Module: sip-router
Branch: master
Commit: b7a06e40596e98f7c44d7166fe72845fde3106e4
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b7a06e4…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Fri Oct 2 16:37:17 2009 +0300
* modules_k/permissions: fixed checking of db connection
- In allow_trusted(), check existence of db connection only when in
non-caching mode.
---
modules_k/permissions/trusted.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/modules_k/permissions/trusted.c b/modules_k/permissions/trusted.c
index aba3822..d7a2a71 100644
--- a/modules_k/permissions/trusted.c
+++ b/modules_k/permissions/trusted.c
@@ -403,13 +403,14 @@ int allow_trusted(struct sip_msg* msg, char *src_ip, int proto)
db_key_t keys[1];
db_val_t vals[1];
db_key_t cols[3];
-
- if (db_handle == 0) {
- LM_ERR("no connection to database\n");
- return -1;
- }
if (db_mode == DISABLE_CACHE) {
+
+ if (db_handle == 0) {
+ LM_ERR("no connection to database\n");
+ return -1;
+ }
+
keys[0] = &source_col;
cols[0] = &proto_col;
cols[1] = &from_col;