aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-24 11:33:06 +0000
committerGitHub <noreply@github.com>2017-01-24 11:33:06 +0000
commit241e2f4c577df4b5c9f52369c3d5041996956feb (patch)
tree72fc44c5c081eb4f118e0803d951c385e2dda505
parent2376a87e73c05e5db8d9eef3ab1edc0dcde4c9ab (diff)
parent5a2c3912f544d80ab0bef982e6a2d5e4cacc9fd2 (diff)
downloadrspamd-241e2f4c577df4b5c9f52369c3d5041996956feb.tar.gz
rspamd-241e2f4c577df4b5c9f52369c3d5041996956feb.zip
Merge pull request #1367 from fatalbanana/rl
[Minor] Small fix for friendly leak rates in ratelimit module
-rw-r--r--src/plugins/lua/ratelimit.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua
index a9d3e65df..6791395de 100644
--- a/src/plugins/lua/ratelimit.lua
+++ b/src/plugins/lua/ratelimit.lua
@@ -560,11 +560,14 @@ if opts then
-- new way of setting limits
fun.each(function(t, lim)
if type(lim) == 'table' then
- settings[t] = lim
- elseif type(lim) == 'string' then
- local plim = parse_string_limit(lim)
- if plim then
- settings[t] = plim
+ if type(lim[2]) == 'number' then
+ settings[t] = lim
+ elseif type(lim[2]) == 'string' then
+ settings[t] = lim
+ local plim = parse_string_limit(lim[2])
+ if plim then
+ settings[t][2] = plim
+ end
end
end
end, opts['rates'])