From faf4c3b5d3e2e36272d976a5a3a63d48d90adce9 Mon Sep 17 00:00:00 2001 From: Naveen Albert Date: Thu, 25 Jan 2024 12:44:29 -0500 Subject: [PATCH] manager.c: Fix erroneous reloads in UpdateConfig. Currently, a reload will always occur if the Reload header is provided for the UpdateConfig action. However, we should not be doing a reload if the header value has a falsy value, per the documentation, so this makes the reload behavior consistent with the existing documentation. Resolves: #551 (cherry picked from commit d50d981543006d2e076c09e396b25a1ebf0837fb) --- main/manager.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/manager.c b/main/manager.c index 48231b72f9..46bcc9493b 100644 --- a/main/manager.c +++ b/main/manager.c @@ -4329,9 +4329,10 @@ static int action_updateconfig(struct mansession *s, const struct message *m) astman_send_ack(s, m, NULL); if (!ast_strlen_zero(rld)) { if (ast_true(rld)) { - rld = NULL; + ast_module_reload(NULL); /* Reload everything */ + } else if (!ast_false(rld)) { + ast_module_reload(rld); /* Reload the specific module */ } - ast_module_reload(rld); } } else { ast_config_destroy(cfg);