summaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/protocol.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index df5e9723e..6f22b5f34 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -702,6 +702,8 @@ rspamd_protocol_http_reply (struct rspamd_http_message *msg, struct rspamd_task
GHashTableIter hiter;
gpointer h, v;
ucl_object_t *top = NULL, *obj;
+ gdouble required_score;
+ gint action;
/* Output the first line - check status */
logbuf = g_string_sized_new (BUFSIZ);
@@ -754,6 +756,17 @@ rspamd_protocol_http_reply (struct rspamd_http_message *msg, struct rspamd_task
}
ucl_object_unref (top);
+ /* Update stat for default metric */
+ metric_res = g_hash_table_lookup (task->results, DEFAULT_METRIC);
+ if (metric_res != NULL) {
+ required_score = metric_res->metric->actions[METRIC_ACTION_REJECT].score;
+ action = check_metric_action (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++;
}