summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-28 17:24:09 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-28 17:24:09 +0100
commit748659036ec90f9613315825ce4597031fbce5c6 (patch)
tree012518033f426368379ccbb9c64732a0cace8511
parent0cb8e6f11263138e1bcedd07da4385628141f8b6 (diff)
downloadrspamd-748659036ec90f9613315825ce4597031fbce5c6.tar.gz
rspamd-748659036ec90f9613315825ce4597031fbce5c6.zip
[Fix] Fix maps preload logic
-rw-r--r--src/libutil/map.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c
index 5a0c859a3..4bcc7c83a 100644
--- a/src/libutil/map.c
+++ b/src/libutil/map.c
@@ -1760,13 +1760,13 @@ rspamd_map_preload (struct rspamd_config *cfg)
gboolean succeed = TRUE;
memset (&fake_cbd, 0, sizeof (fake_cbd));
+ fake_cbd.cbdata.state = 0;
+ fake_cbd.cbdata.prev_data = *map->user_data;
+ fake_cbd.cbdata.cur_data = NULL;
+ fake_cbd.cbdata.map = map;
+ fake_cbd.map = map;
PTR_ARRAY_FOREACH (map->backends, i, bk) {
- fake_cbd.cbdata.state = 0;
- fake_cbd.cbdata.prev_data = *map->user_data;
- fake_cbd.cbdata.cur_data = NULL;
- fake_cbd.cbdata.map = map;
- fake_cbd.map = map;
fake_cbd.cur_backend = i;
if (bk->protocol == MAP_PROTO_FILE) {
@@ -1793,6 +1793,9 @@ rspamd_map_preload (struct rspamd_config *cfg)
*map->user_data = fake_cbd.cbdata.cur_data;
}
}
+ else {
+ msg_info_map ("preload of %s failed", map->name);
+ }
}