aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2019-05-30 13:29:28 +0200
committerBjørn Mork <bjorn@mork.no>2019-05-30 13:39:07 +0200
commitc702a0ee3dd199151786996579b4604a5f7b8927 (patch)
treefc4ee8846cc5c4a7e11ac295b12399960b39f794
parent4d2c72513120d8ed7d6cf4b2500e04d754b96b66 (diff)
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r--obinsectd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/obinsectd.c b/obinsectd.c
index a8beb0e..8a14383 100644
--- a/obinsectd.c
+++ b/obinsectd.c
@@ -1532,12 +1532,17 @@ static int read_and_parse(int fd, unsigned char *rbuf, size_t rbuflen)
/* we might have been requested to read the config file again */
if (reread_cfg) {
- fds[0].revents = 0;
reread_cfg = false;
info("reading new configuration from '%s'\n", cfgfile);
if (cfg)
json_object_put(cfg);
+ cfg = NULL;
read_config();
+
+ /* the publish config must be renewed too */
+ if (!json_object_object_get_ex(cfg, "publish", &pubcfg))
+ pubcfg = NULL;
+
continue;
}
@@ -1779,6 +1784,13 @@ static void read_config()
const char *name;
int i ;
+ /* reset before re-reading */
+ current_list = NULL;
+ memset(log_topic, 0, sizeof(log_topic));
+
+ if (cfg)
+ json_object_put(cfg);
+
cfg = read_json_file(cfgfile, rbuf, bufsize);
if (!cfg)
return;