diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-10-04 16:55:20 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-10-04 16:55:20 +0100 |
commit | e9e7ea8b37bc8e45d21a5418b286bbed389c73cf (patch) | |
tree | 8ea81b3cf37b873e0e53d0ac6cbedc900b8301eb /src/hs_helper.c | |
parent | 3b3831ccc6c475eab6098670e1c6506e1c8d99c8 (diff) | |
download | rspamd-e9e7ea8b37bc8e45d21a5418b286bbed389c73cf.tar.gz rspamd-e9e7ea8b37bc8e45d21a5418b286bbed389c73cf.zip |
[Minor] Fix timer race in hs_helper
Diffstat (limited to 'src/hs_helper.c')
-rw-r--r-- | src/hs_helper.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/hs_helper.c b/src/hs_helper.c index d0fbb1cd9..cfcab33fd 100644 --- a/src/hs_helper.c +++ b/src/hs_helper.c @@ -200,6 +200,8 @@ rspamd_rs_delayed_cb (EV_P_ ev_timer *w, int revents) ctx->event_loop, &srv_cmd, -1, NULL, NULL); ev_timer_stop (EV_A_ w); g_free (w); + + ev_timer_again (EV_A_ &ctx->recompile_timer); } static void @@ -286,6 +288,8 @@ rspamd_hs_helper_reload (struct rspamd_main *rspamd_main, strerror (errno)); } + /* Stop recompile */ + ev_timer_stop (ctx->event_loop, &ctx->recompile_timer); rspamd_rs_compile (ctx, worker, TRUE); return TRUE; @@ -302,7 +306,6 @@ rspamd_hs_helper_timer (EV_P_ ev_timer *w, int revents) tim = rspamd_time_jitter (ctx->recompile_time, 0); w->repeat = tim; rspamd_rs_compile (ctx, worker, FALSE); - ev_timer_again (EV_A_ w); } static void |