[sr-dev] git:master:79c16cd9: htable: test if there is a db table associated with htable for rpc reload
Daniel-Constantin Mierla
miconda at gmail.com
Tue Aug 21 09:06:42 CEST 2018
Module: kamailio
Branch: master
Commit: 79c16cd9bdabb3670b2a7618656ca9cf2f9687b1
URL: https://github.com/kamailio/kamailio/commit/79c16cd9bdabb3670b2a7618656ca9cf2f9687b1
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-08-21T09:05:34+02:00
htable: test if there is a db table associated with htable for rpc reload
---
Modified: src/modules/htable/htable.c
---
Diff: https://github.com/kamailio/kamailio/commit/79c16cd9bdabb3670b2a7618656ca9cf2f9687b1.diff
Patch: https://github.com/kamailio/kamailio/commit/79c16cd9bdabb3670b2a7618656ca9cf2f9687b1.patch
---
diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c
index e667e0bd39..fbe016e0aa 100644
--- a/src/modules/htable/htable.c
+++ b/src/modules/htable/htable.c
@@ -1156,7 +1156,12 @@ static void htable_rpc_reload(rpc_t* rpc, void* c)
rpc->fault(c, 500, "No such htable");
return;
}
-
+ if(ht->dbtable.s==NULL || ht->dbtable.len<=0)
+ {
+ ht_db_close_con();
+ rpc->fault(c, 500, "No database htable");
+ return;
+ }
memcpy(&nht, ht, sizeof(ht_t));
/* it's temporary operation - use system malloc */
More information about the sr-dev
mailing list