summaryrefslogtreecommitdiffstats
path: root/src/fuzzy_storage.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-11 15:30:12 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-11 15:30:30 +0000
commit3c4d37339225ea645f0385aeee1b86238ec41f7c (patch)
treef3bf673a02d9ead6eac7fe5ffeebf5e924282bac /src/fuzzy_storage.c
parent63800059e8dacc1ba69b623719c21355a77301c5 (diff)
downloadrspamd-3c4d37339225ea645f0385aeee1b86238ec41f7c.tar.gz
rspamd-3c4d37339225ea645f0385aeee1b86238ec41f7c.zip
[Feature] Allow to limit maps per specific worker
Diffstat (limited to 'src/fuzzy_storage.c')
-rw-r--r--src/fuzzy_storage.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 94bbc6484..04acc6ba5 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -1975,7 +1975,7 @@ start_fuzzy (struct rspamd_worker *worker)
if (ctx->update_map != NULL) {
rspamd_config_radix_from_ucl (worker->srv->cfg, ctx->update_map,
"Allow fuzzy updates from specified addresses",
- &ctx->update_ips, NULL);
+ &ctx->update_ips, NULL, worker);
}
if (ctx->skip_map != NULL) {
@@ -1986,7 +1986,8 @@ start_fuzzy (struct rspamd_worker *worker)
rspamd_kv_list_read,
rspamd_kv_list_fin,
rspamd_kv_list_dtor,
- (void **)&ctx->skip_hashes)) == NULL) {
+ (void **)&ctx->skip_hashes,
+ worker)) == NULL) {
msg_warn_config ("cannot load hashes list from %s",
ucl_object_tostring (ctx->skip_map));
}
@@ -1998,14 +1999,18 @@ start_fuzzy (struct rspamd_worker *worker)
if (ctx->blocked_map != NULL) {
rspamd_config_radix_from_ucl (worker->srv->cfg, ctx->blocked_map,
"Block fuzzy requests from the specific IPs",
- &ctx->blocked_ips, NULL);
+ &ctx->blocked_ips,
+ NULL,
+ worker);
}
/* Create radix trees */
if (ctx->ratelimit_whitelist_map != NULL) {
rspamd_config_radix_from_ucl (worker->srv->cfg, ctx->ratelimit_whitelist_map,
"Skip ratelimits from specific ip addresses/networks",
- &ctx->ratelimit_whitelist, NULL);
+ &ctx->ratelimit_whitelist,
+ NULL,
+ worker);
}
/* Ratelimits */
@@ -2019,7 +2024,8 @@ start_fuzzy (struct rspamd_worker *worker)
ctx->resolver = rspamd_dns_resolver_init (worker->srv->logger,
ctx->event_loop,
worker->srv->cfg);
- rspamd_map_watch (worker->srv->cfg, ctx->event_loop, ctx->resolver, worker, 0);
+ rspamd_map_watch (worker->srv->cfg, ctx->event_loop,
+ ctx->resolver, worker, RSPAMD_MAP_WATCH_WORKER);
/* Get peer pipe */
memset (&srv_cmd, 0, sizeof (srv_cmd));