mirror of https://github.com/sipwise/kamailio.git
Do not reload trusted table sources in hash buckets, when the db cache mode is disabled. This prevents sudden attempt to actually initialize hash buckets, when the mode is 0. Change-Id: I3e911905f1d73b94883d1f5550b6638b43b47b9f (cherry picked from commitmr14.1.18edd837fd2) (cherry picked from commitdab00faf5e)
parent
2f995fd212
commit
a890c1b70e
@ -0,0 +1,26 @@
|
||||
--- a/src/modules/permissions/rpc.c
|
||||
+++ b/src/modules/permissions/rpc.c
|
||||
@@ -60,12 +60,19 @@ void rpc_trusted_reload(rpc_t *rpc, void
|
||||
return;
|
||||
}
|
||||
|
||||
- if(reload_trusted_table_cmd() != 1) {
|
||||
- rpc->fault(c, 500, "Reload failed.");
|
||||
- goto done;
|
||||
+ // only reload the hash buckets then, when the cache is activated (db_mode = 1)
|
||||
+ if(perm_db_mode == ENABLE_CACHE) {
|
||||
+ if(reload_trusted_table_cmd() != 1) {
|
||||
+ rpc->fault(c, 500, "Reload failed.");
|
||||
+ goto done;
|
||||
+ }
|
||||
+ rpc->rpl_printf(c, "Reload OK");
|
||||
+ } else {
|
||||
+ LM_DBG("Skip trusted sources reload in hash buckets, caching is "
|
||||
+ "disabled.\n");
|
||||
+ rpc->fault(c, 500, "Reload skipped (disabled cache)");
|
||||
}
|
||||
|
||||
- rpc->rpl_printf(c, "Reload OK");
|
||||
done:
|
||||
// reloading is done
|
||||
*perm_rpc_reload_time = time(NULL);
|
||||
Loading…
Reference in new issue