]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to adjust symbols without score change
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 17 Apr 2020 09:16:36 +0000 (10:16 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 17 Apr 2020 09:26:02 +0000 (10:26 +0100)
src/lua/lua_task.c

index 4f92bdb0620db1710dbbaf262294a9d333e8a814..3ad1aa3dbb295a5cc7fbbe35d5eb8f4f58499986 100644 (file)
@@ -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);