Module: kamailio Branch: master Commit: 0039c50e83916c647a2ee38e6be2c39ad17adfcc URL: https://github.com/kamailio/kamailio/commit/0039c50e83916c647a2ee38e6be2c39ad17adfcc
Author: Victor Seva <linuxman...@torreviejawireless.org> Committer: Victor Seva <linuxman...@torreviejawireless.org> Date: 2025-05-27T14:06:20+02:00 permissions: don't allow reloads in the middle of ongoind reload --- Modified: src/modules/permissions/rpc.c --- Diff: https://github.com/kamailio/kamailio/commit/0039c50e83916c647a2ee38e6be2c39ad17adfcc.diff Patch: https://github.com/kamailio/kamailio/commit/0039c50e83916c647a2ee38e6be2c39ad17adfcc.patch --- diff --git a/src/modules/permissions/rpc.c b/src/modules/permissions/rpc.c index 6519c6343c0..7646ee0672e 100644 --- a/src/modules/permissions/rpc.c +++ b/src/modules/permissions/rpc.c @@ -45,7 +45,8 @@ int rpc_check_reload(rpc_t *rpc, void *ctx) rpc->fault(ctx, 500, "ongoing reload"); return -1; } - *perm_rpc_reload_time = time(NULL); + // we are reloading, don't allow new reloads + *perm_rpc_reload_time = time(NULL) + 86400; return 0; } @@ -61,10 +62,13 @@ void rpc_trusted_reload(rpc_t *rpc, void *c) if(reload_trusted_table_cmd() != 1) { rpc->fault(c, 500, "Reload failed."); - return; + goto done; } rpc->rpl_printf(c, "Reload OK"); +done: + // reloading is done + *perm_rpc_reload_time = time(NULL); return; } @@ -101,10 +105,13 @@ void rpc_address_reload(rpc_t *rpc, void *c) if(reload_address_table_cmd() != 1) { rpc->fault(c, 500, "Reload failed."); - return; + goto done; } rpc->rpl_printf(c, "Reload OK"); +done: + // reloading is done + *perm_rpc_reload_time = time(NULL); return; } _______________________________________________ Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org To unsubscribe send an email to sr-dev-le...@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!