From: Vsevolod Stakhov Date: Thu, 28 Oct 2010 14:50:55 +0000 (+0400) Subject: Fixed adding action to metric. X-Git-Tag: 0.3.3~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ee377f4020c25900067e2c11704650b30a0a9e45;p=rspamd.git Fixed adding action to metric. --- 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); }