summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-06 16:17:47 +0100
committerGitHub <noreply@github.com>2016-09-06 16:17:47 +0100
commit8b81536577e231b763fa0f7537e9966de3706314 (patch)
tree78cb2b04989690637d5ff7a0cc76fcf9270b0b10
parent732ea35c7091fc7b52035693db96cd5205015164 (diff)
parent639c54d7cf71845bfad02b86b84c0271198428e3 (diff)
downloadrspamd-8b81536577e231b763fa0f7537e9966de3706314.tar.gz
rspamd-8b81536577e231b763fa0f7537e9966de3706314.zip
Merge pull request #930 from fatalbanana/ratelimit
Ratelimit: remove duplicated division on ham scores; fix registration
-rw-r--r--src/plugins/lua/ratelimit.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua
index 48052502f..8acc3edcf 100644
--- a/src/plugins/lua/ratelimit.lua
+++ b/src/plugins/lua/ratelimit.lua
@@ -103,7 +103,7 @@ local function resize_element(x_score, x_total, element)
x_ip_score = x_score / ip_score_spam_divisor
element = element * rspamd_util.tanh(2.718281 * x_ip_score)
elseif x_score < 0 then
- x_ip_score = (1 + ((x_score / x_total) * -1)) * ip_score_ham_multiplier
+ x_ip_score = ((1 + (x_score * -1)) * ip_score_ham_multiplier)
element = element * x_ip_score
end
return element
@@ -518,7 +518,7 @@ if opts then
symbol = ratelimit_symbol
end
local id = rspamd_config:register_symbol({
- name = ratelimit_symbol,
+ name = symbol,
callback = rate_test,
})
if use_ip_score then