diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-18 11:05:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-18 11:05:32 +0100 |
commit | 76a3ba9cdff99c6b7de8ac4334a7955f80a7361b (patch) | |
tree | 6304e2bf5df591b2649131036bc31e33695ce0fe /src/libserver | |
parent | 3861c33f5dbca4eea6f0cd01f10cb8c778114f7b (diff) | |
download | rspamd-76a3ba9cdff99c6b7de8ac4334a7955f80a7361b.tar.gz rspamd-76a3ba9cdff99c6b7de8ac4334a7955f80a7361b.zip |
[Minor] Fix processing of the skipped tasks (e.g. ping)
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/composites.c | 2 | ||||
-rw-r--r-- | src/libserver/protocol.c | 2 | ||||
-rw-r--r-- | src/libserver/rspamd_symcache.c | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/libserver/composites.c b/src/libserver/composites.c index 33926f6e5..8471d0e93 100644 --- a/src/libserver/composites.c +++ b/src/libserver/composites.c @@ -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); } } diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index ef8700340..a7abc5947 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -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"); diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c index a484c738b..71b8a4c6a 100644 --- a/src/libserver/rspamd_symcache.c +++ b/src/libserver/rspamd_symcache.c @@ -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); |