aboutsummaryrefslogtreecommitdiffstats
path: root/src/fuzzy_storage.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-05 12:50:11 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-05 12:50:11 +0100
commit553b3801670723429abf5f66420683f6d39a3c72 (patch)
tree2cc75027d6aaace6d91486c557f4c105c32e561d /src/fuzzy_storage.c
parent2167e2c030e1a953e0d4eedb235d15f02ffe05c8 (diff)
downloadrspamd-553b3801670723429abf5f66420683f6d39a3c72.tar.gz
rspamd-553b3801670723429abf5f66420683f6d39a3c72.zip
Fix fuzzy storage initialization and finalization.
Diffstat (limited to 'src/fuzzy_storage.c')
-rw-r--r--src/fuzzy_storage.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 105e3b95c..9fd6d056e 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -269,10 +269,13 @@ sigterm_handler (gint fd, short what, void *arg)
};
ctx = worker->ctx;
+ event_del (&worker->sig_ev_usr1);
+ event_del (&worker->sig_ev_usr2);
+ event_del (&worker->bind_ev);
+ close (worker->cf->listen_sock);
mods = ctx->max_mods + 1;
sync_cache (worker);
- close (worker->cf->listen_sock);
- (void)event_loopexit (&tv);
+ (void)event_base_loopexit (ctx->ev_base, &tv);
}
/*
@@ -287,16 +290,17 @@ sigusr2_handler (gint fd, short what, void *arg)
struct rspamd_fuzzy_storage_ctx *ctx;
ctx = worker->ctx;
- tv.tv_sec = SOFT_SHUTDOWN_TIME;
+ tv.tv_sec = 0;
tv.tv_usec = 0;
event_del (&worker->sig_ev_usr1);
event_del (&worker->sig_ev_usr2);
event_del (&worker->bind_ev);
close (worker->cf->listen_sock);
msg_info ("worker's shutdown is pending in %d sec", SOFT_SHUTDOWN_TIME);
- event_base_loopexit (ctx->ev_base, &tv);
mods = ctx->max_mods + 1;
sync_cache (worker);
+
+ event_base_loopexit (ctx->ev_base, &tv);
return;
}
@@ -854,6 +858,7 @@ parse_fuzzy_update_list (struct rspamd_fuzzy_storage_ctx *ctx)
}
radix32tree_add (ctx->update_ips, htonl (ina.s_addr), mask, 1);
}
+ cur ++;
}
return (ctx->update_ips != NULL);