From: Vsevolod Stakhov Date: Thu, 28 Jun 2018 16:24:09 +0000 (+0100) Subject: [Fix] Fix maps preload logic X-Git-Tag: 1.7.7~14 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=748659036ec90f9613315825ce4597031fbce5c6;p=rspamd.git [Fix] Fix maps preload logic --- 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); + } }