]> source.dussan.org Git - rspamd.git/commitdiff
Fixed adding action to metric.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 28 Oct 2010 14:50:55 +0000 (18:50 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 28 Oct 2010 14:50:55 +0000 (18:50 +0400)
src/filter.c

index 73f45211be9b23544ecce6c0c9a01501bb189bfb..f47dd1a3ae6b8c240da6d0455fe44bbab0e4c30d 100644 (file)
@@ -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);
                }