aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-17 10:16:36 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-17 10:26:02 +0100
commitc0bcfaff59f0442c63ca6530fdabfb684edef1d3 (patch)
tree56ec1a9753ac4acb44c3980cddc08346752eb9c7
parentacc9a3ceaa4c7f4eccf7d81de87935d814dc3fd5 (diff)
downloadrspamd-c0bcfaff59f0442c63ca6530fdabfb684edef1d3.tar.gz
rspamd-c0bcfaff59f0442c63ca6530fdabfb684edef1d3.zip
[Minor] Allow to adjust symbols without score change
-rw-r--r--src/lua/lua_task.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 4f92bdb06..3ad1aa3db 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -2003,9 +2003,11 @@ lua_task_adjust_result (lua_State * L)
}
if (s) {
- metric_res->score -= s->score;
- s->score = weight;
- metric_res->score += s->score;
+ if (!isnan (weight)) {
+ metric_res->score -= s->score;
+ s->score = weight;
+ metric_res->score += s->score;
+ }
}
else {
return luaL_error (L, "symbol not found: %s", symbol_name);