]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] More stages fixes
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 18 Aug 2019 08:57:04 +0000 (09:57 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 18 Aug 2019 08:57:04 +0000 (09:57 +0100)
src/libserver/rspamd_symcache.c
src/libserver/task.h

index 71d3ab5e8e3f5cb9e1087a37cf39e026b0fab07a..a484c738b7008079edc57b8a01695c999e83ddea 100644 (file)
@@ -1940,6 +1940,7 @@ rspamd_symcache_process_symbols (struct rspamd_task *task,
        gboolean all_done;
        gint saved_priority;
        enum rspamd_cache_savepoint_stage next;
+       gint next_task_stage;
        guint start_events_pending;
 
        g_assert (cache != NULL);
@@ -1962,7 +1963,8 @@ rspamd_symcache_process_symbols (struct rspamd_task *task,
                checkpoint->pass = RSPAMD_CACHE_PASS_IDEMPOTENT;
        }
 
-       msg_debug_cache_task ("symbols processing stage at pass: %d", checkpoint->pass);
+       msg_debug_cache_task ("symbols processing stage at pass: %d, %d stage requested",
+                       checkpoint->pass, stage);
        start_events_pending = rspamd_session_events_pending (task->s);
 
        switch (checkpoint->pass) {
@@ -1976,11 +1978,14 @@ rspamd_symcache_process_symbols (struct rspamd_task *task,
                if (checkpoint->pass != RSPAMD_CACHE_PASS_PREFILTERS) {
                        sel = cache->prefilters_empty;
                        next = RSPAMD_CACHE_PASS_PREFILTERS;
+                       next_task_stage = RSPAMD_TASK_STAGE_PRE_FILTERS;
                        checkpoint->pass = RSPAMD_CACHE_PASS_PREFILTERS_EMPTY;
                }
                else {
                        sel = cache->prefilters;
                        next = RSPAMD_CACHE_PASS_FILTERS;
+                       checkpoint->pass = RSPAMD_CACHE_PASS_PREFILTERS;
+                       next_task_stage = RSPAMD_TASK_STAGE_FILTERS;
                }
 
 
@@ -2015,11 +2020,11 @@ rspamd_symcache_process_symbols (struct rspamd_task *task,
                        }
                }
 
-               if (all_done || stage == next) {
+               if (all_done || stage == next_task_stage) {
                        checkpoint->pass = next;
                }
 
-               if (stage == next) {
+               if (stage == next_task_stage) {
                        return rspamd_symcache_process_symbols (task, cache, stage);
                }
 
index 573f6d9b708fbfc3445d52d4df2d79da9692c4d7..a96e2ac053b571a382adbbf38d894bf13d63a020 100644 (file)
@@ -62,6 +62,7 @@ enum rspamd_task_stage {
 
 #define RSPAMD_TASK_PROCESS_ALL (RSPAMD_TASK_STAGE_CONNECT | \
         RSPAMD_TASK_STAGE_ENVELOPE | \
+        RSPAMD_TASK_STAGE_PRE_FILTERS_EMPTY | \
         RSPAMD_TASK_STAGE_READ_MESSAGE | \
         RSPAMD_TASK_STAGE_PRE_FILTERS | \
         RSPAMD_TASK_STAGE_PROCESS_MESSAGE | \