]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix maps preload logic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Jun 2018 16:24:09 +0000 (17:24 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Jun 2018 16:24:09 +0000 (17:24 +0100)
src/libutil/map.c

index 5a0c859a37673107a3454e18125fc9d10786b8a4..4bcc7c83a3d8697046da97ef38803c78fcb64615 100644 (file)
@@ -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);
+                       }
 
                }