aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-04-02 21:17:28 +0200
committerKim Alvefur <zash@zash.se>2019-04-02 21:17:28 +0200
commita6571e3ef33936cb4f2b99b582148accc60af846 (patch)
tree461136db0a04c8423d923b9545201fe521b73056 /plugins
parentce1056dc43fb98b6df1b025e621c28cf4cabf7b9 (diff)
downloadprosody-a6571e3ef33936cb4f2b99b582148accc60af846.tar.gz
prosody-a6571e3ef33936cb4f2b99b582148accc60af846.zip
mod_limits: Fix indentation
Appears to have been messed up in 60e113f3682f
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_limits.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/mod_limits.lua b/plugins/mod_limits.lua
index 914d5c44..32bc75a9 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 sess_throttle = session.throttle;
- if sess_throttle then
- local ok, balance, outstanding = sess_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", sess_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 sess_throttle:peek(#outstanding_data) then
+ if sess_throttle:peek(#outstanding_data) then
session.log("debug", "Resuming paused session");
session.conn:resume();
end