]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix exceptions list in surbl
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 31 Aug 2017 20:24:49 +0000 (21:24 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Sep 2017 06:44:48 +0000 (07:44 +0100)
src/plugins/surbl.c

index 999a8c1c4520de878a4603a410a657bba3c140da..a44524e70826faaea8dc987ddd368bd80c5f8711 100644 (file)
@@ -154,9 +154,22 @@ read_exceptions_list (gchar * chunk,
        struct map_cb_data *data,
        gboolean final)
 {
+       GHashTable **t;
+       guint i;
+
        if (data->cur_data == NULL) {
+               t = data->prev_data;
+
+               for (i = 0; i < MAX_LEVELS; i++) {
+                       if (t[i] != NULL) {
+                               g_hash_table_destroy (t[i]);
+                       }
+                       t[i] = NULL;
+               }
+
                data->cur_data = data->prev_data;
        }
+
        return rspamd_parse_kv_list (
                           chunk,
                           len,
@@ -176,9 +189,12 @@ fin_exceptions_list (struct map_cb_data *data)
                t = data->prev_data;
                for (i = 0; i < MAX_LEVELS; i++) {
                        if (t[i] != NULL) {
-                               g_hash_table_destroy (t[i]);
+                               rspamd_default_log_function (G_LOG_LEVEL_DEBUG,
+                                               "surbl", "",
+                                               G_STRFUNC,
+                                               "exceptions level %d: %d elements",
+                                               i, g_hash_table_size (t[i]));
                        }
-                       t[i] = NULL;
                }
        }
 }