summaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-05-02 15:12:07 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-05-02 15:12:07 +0100
commit392e39b893d0fe19b764f70bc369edd92bacd76d (patch)
tree011a3df537e674e04bdb6971bc050d53aa33e6a0 /src/libserver
parent14a450ad99698225bf37dff1833b313b78367184 (diff)
downloadrspamd-392e39b893d0fe19b764f70bc369edd92bacd76d.tar.gz
rspamd-392e39b893d0fe19b764f70bc369edd92bacd76d.zip
Write to stat after scanning.
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++;
}