]> source.dussan.org Git - rspamd.git/commitdiff
Add no_stat flag.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 25 Sep 2015 14:07:04 +0000 (15:07 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 25 Sep 2015 14:07:04 +0000 (15:07 +0100)
Issue: #382

src/libserver/protocol.c
src/libserver/task.h

index 8cf6b771f84bb436a614fcb461fc35758c03d200..360239f34a0b407479dd14e39d2279eecaa6a101 100644 (file)
@@ -1154,18 +1154,21 @@ rspamd_protocol_http_reply (struct rspamd_http_message *msg,
        }
        ucl_object_unref (top);
 
-       /* Update stat for default metric */
-       metric_res = g_hash_table_lookup (task->results, DEFAULT_METRIC);
-       if (metric_res != NULL) {
-               action = rspamd_check_action_metric (task, metric_res->score, &required_score,
-                               metric_res->metric);
-               if (action <= METRIC_ACTION_NOACTION) {
-                       task->worker->srv->stat->actions_stat[action]++;
+       if (!(task->flags & RSPAMD_TASK_FLAG_NO_STAT)) {
+               /* Update stat for default metric */
+               metric_res = g_hash_table_lookup (task->results, DEFAULT_METRIC);
+               if (metric_res != NULL) {
+                       action = rspamd_check_action_metric (task, metric_res->score, &required_score,
+                                       metric_res->metric);
+                       if (action <= METRIC_ACTION_NOACTION) {
+                               task->worker->srv->stat->actions_stat[action]++;
+                       }
                }
-       }
 
-       /* Increase counters */
-       task->worker->srv->stat->messages_scanned++;
+               /* Increase counters */
+
+               task->worker->srv->stat->messages_scanned++;
+       }
 }
 
 void
index 01d3aff423e6fea194c9177054d23fd6493a57c2..16c3d4a70b9af1c0cb8d6f38091e2ceb0c15e106 100644 (file)
@@ -91,6 +91,7 @@ enum rspamd_task_stage {
 #define RSPAMD_TASK_FLAG_PROCESSING (1 << 10)
 #define RSPAMD_TASK_FLAG_GTUBE (1 << 11)
 #define RSPAMD_TASK_FLAG_FILE (1 << 12)
+#define RSPAMD_TASK_FLAG_NO_STAT (1 << 13)
 
 #define RSPAMD_TASK_IS_SKIPPED(task) (((task)->flags & RSPAMD_TASK_FLAG_SKIP))
 #define RSPAMD_TASK_IS_JSON(task) (((task)->flags & RSPAMD_TASK_FLAG_JSON))