summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-10 11:02:08 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-10 11:02:08 +0100
commitdaec65bd2a68c04b9144dff91c863cfd2cb30b93 (patch)
tree787ae4920fcf1ee3bca1a3cb693c49114270fc0f
parent6ecdf48de0f269be6924ec128fc8400cfba293a3 (diff)
downloadrspamd-daec65bd2a68c04b9144dff91c863cfd2cb30b93.tar.gz
rspamd-daec65bd2a68c04b9144dff91c863cfd2cb30b93.zip
[Fix] Do not try to process skipped messages
-rw-r--r--src/libserver/symbols_cache.c12
-rw-r--r--src/lua/lua_task.c5
2 files changed, 17 insertions, 0 deletions
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c
index 6076d1743..69a1f7158 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 e4defa667..e60fe6592 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);
}