diff options
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/worker_util.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c index 3da7af891..99829edb0 100644 --- a/src/libserver/worker_util.c +++ b/src/libserver/worker_util.c @@ -67,6 +67,10 @@ rspamd_worker_usr2_handler (gint fd, short what, void *arg) msg_info ("worker's shutdown is pending in %d sec", SOFT_SHUTDOWN_TIME); event_base_loopexit (sigh->base, &tv); } + + if (sigh->post_handler) { + sigh->post_handler (sigh->handler_data); + } } /* @@ -79,6 +83,10 @@ rspamd_worker_usr1_handler (gint fd, short what, void *arg) (struct rspamd_worker_signal_handler *)arg; reopen_log (sigh->worker->srv->logger); + + if (sigh->post_handler) { + sigh->post_handler (sigh->handler_data); + } } static void @@ -98,6 +106,10 @@ rspamd_worker_term_handler (gint fd, short what, void *arg) ProfilerStop (); #endif } + + if (sigh->post_handler) { + sigh->post_handler (sigh->handler_data); + } } static void @@ -118,7 +130,7 @@ rspamd_worker_set_signal_handler (int signo, struct rspamd_worker *worker, { struct rspamd_worker_signal_handler *sigh; - sigh = g_malloc (sizeof (*sigh)); + sigh = g_malloc0 (sizeof (*sigh)); sigh->signo = signo; sigh->worker = worker; sigh->base = base; |