]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix processing of the skipped tasks (e.g. ping)
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 18 Aug 2019 10:05:32 +0000 (11:05 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 18 Aug 2019 10:05:32 +0000 (11:05 +0100)
src/libserver/composites.c
src/libserver/protocol.c
src/libserver/rspamd_symcache.c

index 33926f6e5054e020bc0f0e4f170b50cc0e63dc2f..8471d0e939140feaa61dbc40fce10fa49a04960d 100644 (file)
@@ -695,7 +695,7 @@ composites_metric_callback (struct rspamd_scan_result *metric_res,
 void
 rspamd_make_composites (struct rspamd_task *task)
 {
-       if (task->result) {
+       if (task->result && !RSPAMD_TASK_IS_SKIPPED (task)) {
                composites_metric_callback (task->result, task);
        }
 }
index ef8700340a19926d6fe4356f9f0b57f119fb20db..a7abc59479389e0159abbb1f35067fa6144c97d3 100644 (file)
@@ -177,6 +177,8 @@ rspamd_protocol_handle_url (struct rspamd_task *task,
                if (COMPARE_CMD (p, MSG_CMD_PING, pathlen)) {
                        msg_debug_protocol ("got ping command");
                        task->cmd = CMD_PING;
+                       task->flags |= RSPAMD_TASK_FLAG_SKIP;
+                       task->processed_stages |= RSPAMD_TASK_STAGE_DONE; /* Skip all */
                }
                else if (COMPARE_CMD (p, MSG_CMD_PROCESS, pathlen)) {
                        msg_debug_protocol ("got process -> old check command");
index a484c738b7008079edc57b8a01695c999e83ddea..71b8a4c6a6e1b174d94edddc3fd8006a0114b201 100644 (file)
@@ -3124,6 +3124,10 @@ rspamd_symcache_composites_foreach (struct rspamd_task *task,
        struct rspamd_symcache_item *item;
        struct rspamd_symcache_dynamic_item *dyn_item;
 
+       if (task->checkpoint == NULL) {
+               return;
+       }
+
        PTR_ARRAY_FOREACH (cache->composites, i, item) {
                dyn_item = rspamd_symcache_get_dynamic (task->checkpoint, item);