diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-03-30 17:57:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-30 17:57:50 +0100 |
commit | f62b23fdebe3a0630121f1e515a5e2846b8ef827 (patch) | |
tree | 78f951996ae74be59aabc2744729bd7539333f79 | |
parent | 415d7637aa80efa6f89bb148eabe1d79ea3c6391 (diff) | |
parent | 092940ed5bf515c1176f1315b047ac1a76ae6733 (diff) | |
download | rspamd-f62b23fdebe3a0630121f1e515a5e2846b8ef827.tar.gz rspamd-f62b23fdebe3a0630121f1e515a5e2846b8ef827.zip |
Merge pull request #4448 from simbuerg/simbuerg/fix-double-dip-ratelimit
[Fix] Avoid double-dip of nrcpt when calculating ratelimit condition
-rw-r--r-- | lualib/redis_scripts/ratelimit_check.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lualib/redis_scripts/ratelimit_check.lua b/lualib/redis_scripts/ratelimit_check.lua index aa7f564ef..1c2b32a69 100644 --- a/lualib/redis_scripts/ratelimit_check.lua +++ b/lualib/redis_scripts/ratelimit_check.lua @@ -62,7 +62,7 @@ if burst + pending > 0 then if dynb == 0 then dynb = 0.0001 end burst = burst + pending - if burst > 0 and (burst + nrcpt) > max_burst * dynb then + if burst > 0 and burst > max_burst * dynb then return {1, tostring(burst - pending), tostring(dynr), tostring(dynb), tostring(leaked)} end -- Increase pending if we allow ratelimit |