]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix ratelimit ctime setting
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 20 Apr 2016 12:50:22 +0000 (13:50 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 20 Apr 2016 12:50:22 +0000 (13:50 +0100)
src/plugins/lua/ratelimit.lua

index 4bca76f93bf4fd893e9566f5f220e3a6adb7f525..a6328eb4ddd03d8983be7d520cc85bcece3e9891 100644 (file)
@@ -94,6 +94,10 @@ local function parse_limits(data)
         ctime = tonumber(elts[3])
       end
 
+      if not ctime then
+        ctime = atime
+      end
+
       return {atime,bucket,ctime}
     end
   end
@@ -222,7 +226,7 @@ local function set_limits(task, args)
           end
         end
 
-        local lstr = string.format('%.3f:%.3f:.3f', ntime, bucket, ctime)
+        local lstr = string.format('%.3f:%.3f:%.3f', ntime, bucket, ctime)
         table.insert(values, limit[2])
         table.insert(values, lstr)
       end, _.zip(parse_limits(data), _.iter(args)))