diff options
author | Kim Alvefur <zash@zash.se> | 2018-05-02 13:58:28 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-05-02 13:58:28 +0200 |
commit | 3ec84c6b47daa7cb351157078cae3673023e2d61 (patch) | |
tree | 9017445f528f08af92d7404553641551a54a6c10 /plugins/mod_limits.lua | |
parent | 2d1ac91f08c01eda30fc279d5fe8d976f779c7a6 (diff) | |
download | prosody-3ec84c6b47daa7cb351157078cae3673023e2d61.tar.gz prosody-3ec84c6b47daa7cb351157078cae3673023e2d61.zip |
mod_limits: Rename variable to avoid name clash [luacheck]
FIXME better name, s_throttle doesn't seem nice
Diffstat (limited to 'plugins/mod_limits.lua')
-rw-r--r-- | plugins/mod_limits.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/mod_limits.lua b/plugins/mod_limits.lua index 3fc3fcaa..914d5c44 100644 --- a/plugins/mod_limits.lua +++ b/plugins/mod_limits.lua @@ -51,18 +51,18 @@ end local default_filter_set = {}; function default_filter_set.bytes_in(bytes, session) - local throttle = session.throttle; - if throttle then - local ok, balance, outstanding = throttle:poll(#bytes, true); + local sess_throttle = session.throttle; + if sess_throttle then + local ok, balance, outstanding = sess_throttle:poll(#bytes, true); if not ok then - session.log("debug", "Session over rate limit (%d) with %d (by %d), pausing", throttle.max, #bytes, outstanding); + session.log("debug", "Session over rate limit (%d) with %d (by %d), pausing", sess_throttle.max, #bytes, outstanding); outstanding = ceil(outstanding); session.conn:pause(); -- Read no more data from the connection until there is no outstanding data local outstanding_data = bytes:sub(-outstanding); bytes = bytes:sub(1, #bytes-outstanding); timer.add_task(limits_resolution, function () if not session.conn then return; end - if throttle:peek(#outstanding_data) then + if sess_throttle:peek(#outstanding_data) then session.log("debug", "Resuming paused session"); session.conn:resume(); end |