From 0461ea730f54b8c0a63290b2e2ff9e2c149f21b7 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 3 May 2016 16:51:09 +0100 Subject: [PATCH] [CritFix] Really skip filters in case of pre-result set --- src/libserver/task.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libserver/task.c b/src/libserver/task.c index c96104b2a..b3019c004 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -426,6 +426,14 @@ rspamd_task_process (struct rspamd_task *task, guint stages) return TRUE; } + if (task->pre_result.action != METRIC_ACTION_MAX) { + /* Skip all if we have result here */ + task->processed_stages |= RSPAMD_TASK_STAGE_DONE; + msg_info_task ("skip filters, as pre-filter returned %s action", + rspamd_action_to_str (task->pre_result.action)); + } + + task->flags |= RSPAMD_TASK_FLAG_PROCESSING; st = rspamd_task_select_processing_stage (task, stages); @@ -439,13 +447,6 @@ rspamd_task_process (struct rspamd_task *task, guint stages) case RSPAMD_TASK_STAGE_PRE_FILTERS: rspamd_lua_call_pre_filters (task); - - if (task->pre_result.action != METRIC_ACTION_MAX) { - /* Skip all if we have result here */ - task->processed_stages |= RSPAMD_TASK_STAGE_DONE; - msg_info_task ("skip filters, as pre-filter returned %s action", - rspamd_action_to_str (task->pre_result.action)); - } break; case RSPAMD_TASK_STAGE_FILTERS: -- 2.39.5