]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Store real required score inside metric result
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 6 Nov 2015 14:51:16 +0000 (14:51 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 6 Nov 2015 14:51:16 +0000 (14:51 +0000)
src/libmime/filter.h
src/libserver/protocol.c

index aec06d670b067595cf0685079f30deb7f0191cbc..51a1d430477a3703ee969967ea13f67878fe4840 100644 (file)
@@ -50,11 +50,12 @@ struct metric {
 struct metric_result {
        struct metric *metric;                          /**< pointer to metric structure                        */
        double score;                                   /**< total score                                                        */
-       enum rspamd_metric_action action;                               /**< the current action                                         */
+       double required_score;                          /**< real required score                                        */
+       double grow_factor;                                                             /**< current grow factor                                        */
        GHashTable *symbols;                            /**< symbols of metric                                          */
        GHashTable *sym_groups;                                                 /**< groups of symbols                                          */
        gboolean checked;                               /**< whether metric result is consolidated  */
-       double grow_factor;                             /**< current grow factor                                        */
+       enum rspamd_metric_action action;                /**< the current action                                                */
 };
 
 /**
index 35697427fcc93d558445586a140198a966295040..10bbbe2a5e9cb8f319b0082fefda1ccccd21405f 100644 (file)
@@ -817,12 +817,11 @@ rspamd_metric_result_ucl (struct rspamd_task *task,
        enum rspamd_metric_action action = METRIC_ACTION_NOACTION;
        ucl_object_t *obj = NULL, *sobj;;
        gpointer h, v;
-       double required_score;
        const gchar *subject;
 
        m = mres->metric;
        mres->action = rspamd_check_action_metric (task, mres->score,
-                                       &required_score, m);
+                                       &mres->required_score, m);
 
        action = mres->action;
        is_spam = (action == METRIC_ACTION_REJECT);
@@ -834,7 +833,7 @@ rspamd_metric_result_ucl (struct rspamd_task *task,
                "is_skipped", 0, false);
        ucl_object_insert_key (obj, ucl_object_fromdouble (mres->score),
                "score", 0, false);
-       ucl_object_insert_key (obj, ucl_object_fromdouble (required_score),
+       ucl_object_insert_key (obj, ucl_object_fromdouble (mres->required_score),
                "required_score", 0, false);
        ucl_object_insert_key (obj,
                ucl_object_fromstring (rspamd_action_to_str (action)),