]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not try to process skipped messages
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 10 Aug 2018 10:02:08 +0000 (11:02 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 10 Aug 2018 10:02:08 +0000 (11:02 +0100)
src/libserver/symbols_cache.c
src/lua/lua_task.c

index 6076d1743e42039310d388c038b58a4f7884d379..69a1f715868861b3ac9b181d9d9d861d62a06d2f 100644 (file)
@@ -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) &&
index e4defa667c386cd07cd043a4d1916ecd779badf0..e60fe65925ba9f06aa8d4bff33500a39c15a6d47 100644 (file)
@@ -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);
                }