summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-28 18:50:55 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-28 18:50:55 +0400
commitee377f4020c25900067e2c11704650b30a0a9e45 (patch)
tree9a1ec5343e55edc15f75c972efb3e99e5a60831c
parent3fe671c49e5f3fc4798c67a57a2089bdfc6bc530 (diff)
downloadrspamd-ee377f4020c25900067e2c11704650b30a0a9e45.tar.gz
rspamd-ee377f4020c25900067e2c11704650b30a0a9e45.zip
Fixed adding action to metric.
-rw-r--r--src/filter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/filter.c b/src/filter.c
index 73f45211b..f47dd1a3a 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -659,6 +659,7 @@ check_metric_action (double score, double required_score, struct metric *metric)
{
GList *cur;
struct metric_action *action, *selected_action = NULL;
+ double max_score = 0;
if (score >= required_score) {
return metric->action;
@@ -670,8 +671,9 @@ check_metric_action (double score, double required_score, struct metric *metric)
cur = metric->actions;
while (cur) {
action = cur->data;
- if (score >= action->score) {
+ if (score >= action->score && action->score > max_score) {
selected_action = action;
+ max_score = action->score;
}
cur = g_list_next (cur);
}