commit 3861c33: [Fix] More stages fixes

Vsevolod Stakhov vsevolod at highsecure.ru
Sun Aug 18 09:00:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-08-18 09:57:04 +0100
URL: https://github.com/rspamd/rspamd/commit/3861c33f5dbca4eea6f0cd01f10cb8c778114f7b (HEAD -> master)

[Fix] More stages fixes

---
 src/libserver/rspamd_symcache.c | 11 ++++++++---
 src/libserver/task.h            |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c
index 71d3ab5e8..a484c738b 100644
--- a/src/libserver/rspamd_symcache.c
+++ b/src/libserver/rspamd_symcache.c
@@ -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);
 		}
 
diff --git a/src/libserver/task.h b/src/libserver/task.h
index 573f6d9b7..a96e2ac05 100644
--- a/src/libserver/task.h
+++ b/src/libserver/task.h
@@ -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 | \


More information about the Commits mailing list