diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-24 08:43:42 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-24 08:43:42 +0100 |
commit | 2f0c6e0f26c6d96442c24e54331c2939ca50127c (patch) | |
tree | d13f136708fc0513bb4e7cc224894ccdc635a950 /src/libserver/worker_util.c | |
parent | e853ac873adbf4730f5c6593a410da310df35cac (diff) | |
download | rspamd-2f0c6e0f26c6d96442c24e54331c2939ca50127c.tar.gz rspamd-2f0c6e0f26c6d96442c24e54331c2939ca50127c.zip |
[Minor] Prevent data corruption when dealing with signals
Diffstat (limited to 'src/libserver/worker_util.c')
-rw-r--r-- | src/libserver/worker_util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c index 7753fa1b3..9791c1989 100644 --- a/src/libserver/worker_util.c +++ b/src/libserver/worker_util.c @@ -338,19 +338,23 @@ rspamd_worker_stop_accept (struct rspamd_worker *worker) if (worker->accept_events != NULL) { g_list_free (worker->accept_events); } - + /* XXX: we need to do it much later */ +#if 0 g_hash_table_iter_init (&it, worker->signal_events); while (g_hash_table_iter_next (&it, &k, &v)) { sigh = (struct rspamd_worker_signal_handler *)v; g_hash_table_iter_steal (&it); + if (sigh->enabled) { event_del (&sigh->ev); } + g_free (sigh); } g_hash_table_unref (worker->signal_events); +#endif /* Cleanup maps */ for (cur = worker->srv->cfg->maps; cur != NULL; cur = g_list_next (cur)) { @@ -820,6 +824,7 @@ rspamd_worker_monitored_on_change (struct rspamd_monitored_ctx *ctx, rspamd_monitored_get_tag (m, tag); ev_base = rspamd_monitored_ctx_get_ev_base (ctx); + memset (&srv_cmd, 0, sizeof (srv_cmd)); srv_cmd.type = RSPAMD_SRV_MONITORED_CHANGE; rspamd_strlcpy (srv_cmd.cmd.monitored_change.tag, tag, sizeof (srv_cmd.cmd.monitored_change.tag)); |