From: Vsevolod Stakhov Date: Fri, 10 Aug 2018 10:02:08 +0000 (+0100) Subject: [Fix] Do not try to process skipped messages X-Git-Tag: 1.8.0~285 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daec65bd2a68c04b9144dff91c863cfd2cb30b93;p=thirdparty%2Frspamd.git [Fix] Do not try to process skipped messages --- diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index 6076d1743e..69a1f71586 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -1709,6 +1709,10 @@ rspamd_symbols_cache_process_symbols (struct rspamd_task * task, for (i = 0; i < (gint)cache->prefilters->len; i ++) { item = g_ptr_array_index (cache->prefilters, i); + if (RSPAMD_TASK_IS_SKIPPED (task)) { + return TRUE; + } + if (!isset (checkpoint->processed_bits, item->id * 2) && !isset (checkpoint->processed_bits, item->id * 2 + 1)) { /* Check priorities */ @@ -1762,6 +1766,10 @@ rspamd_symbols_cache_process_symbols (struct rspamd_task * task, * we just save it for another pass */ for (i = 0; i < (gint)checkpoint->version; i ++) { + if (RSPAMD_TASK_IS_SKIPPED (task)) { + return TRUE; + } + item = g_ptr_array_index (checkpoint->order->d, i); if (item->type & SYMBOL_TYPE_CLASSIFIER) { @@ -1882,6 +1890,10 @@ rspamd_symbols_cache_process_symbols (struct rspamd_task * task, saved_priority = G_MININT; for (i = 0; i < (gint)cache->postfilters->len; i ++) { + if (RSPAMD_TASK_IS_SKIPPED (task)) { + return TRUE; + } + item = g_ptr_array_index (cache->postfilters, i); if (!isset (checkpoint->processed_bits, item->id * 2) && diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index e4defa667c..e60fe65925 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -1572,6 +1572,11 @@ lua_task_set_pre_result (lua_State * L) if (task != NULL) { + if (RSPAMD_TASK_IS_SKIPPED (task)) { + /* Do not set pre-result for a skipped task */ + return 0; + } + if (lua_type (L, 2) == LUA_TNUMBER) { action = lua_tointeger (L, 2); }