]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Small fix for friendly leak rates in ratelimit module 1367/head
authorAndrew Lewis <nerf@judo.za.org>
Tue, 24 Jan 2017 09:47:51 +0000 (11:47 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Tue, 24 Jan 2017 09:47:51 +0000 (11:47 +0200)
src/plugins/lua/ratelimit.lua

index a9d3e65dfdefdbc6eb37aaa97d802e4efa9f89b3..6791395dec14970c708f74f942ad4755d488014a 100644 (file)
@@ -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'])