From: Andrew Lewis Date: Tue, 24 Jan 2017 09:47:51 +0000 (+0200) Subject: [Minor] Small fix for friendly leak rates in ratelimit module X-Git-Tag: 1.5.0~272^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1367%2Fhead;p=thirdparty%2Frspamd.git [Minor] Small fix for friendly leak rates in ratelimit module --- diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index a9d3e65dfd..6791395dec 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'])