commit e6e1267: [Minor] Fix some more issues after actions rework

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Jan 14 18:00:15 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-01-14 17:59:21 +0000
URL: https://github.com/rspamd/rspamd/commit/e6e1267ea76d6ea0ede2e60a1d7e0bc82c5efdf5 (HEAD -> master)

[Minor] Fix some more issues after actions rework

---
 src/libmime/filter.c | 4 ++--
 src/libserver/task.c | 6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/libmime/filter.c b/src/libmime/filter.c
index ea9b500c9..45563e23f 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/filter.c
@@ -494,7 +494,6 @@ rspamd_check_action_metric (struct rspamd_task *task)
 	struct rspamd_passthrough_result *pr;
 	double max_score = -(G_MAXDOUBLE), sc;
 	int i;
-	gboolean set_action = FALSE;
 	struct rspamd_metric_result *mres = task->result;
 
 	/* We are not certain about the results during processing */
@@ -507,7 +506,8 @@ rspamd_check_action_metric (struct rspamd_task *task)
 				noaction = action_lim;
 			}
 
-			if (isnan (sc)) {
+			if (isnan (sc) ||
+			 	(action_lim->action->flags & (RSPAMD_ACTION_NO_THRESHOLD|RSPAMD_ACTION_HAM))) {
 				continue;
 			}
 
diff --git a/src/libserver/task.c b/src/libserver/task.c
index df1a561cb..2b00f6805 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -1553,7 +1553,11 @@ rspamd_task_get_required_score (struct rspamd_task *task, struct rspamd_metric_r
 	}
 
 	for (i = m->nactions - 1; i >= 0; i --) {
-		if (!isnan (m->actions_limits[i].cur_limit)) {
+		struct rspamd_action_result *action_lim = &m->actions_limits[i];
+
+
+		if (!isnan (action_lim->cur_limit) &&
+				!(action_lim->action->flags & (RSPAMD_ACTION_NO_THRESHOLD|RSPAMD_ACTION_HAM))) {
 			return m->actions_limits[i].cur_limit;
 		}
 	}


More information about the Commits mailing list