aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-01-04 21:38:14 +0000
committerMatthew Wild <mwild1@gmail.com>2011-01-04 21:38:14 +0000
commit71960dbef32583ee4e65cedc57faac5a11638d6a (patch)
treecff0414073987339892e002d9b06e5bcb882c1cc /plugins
parentbd53177ccc57a7551a48e45c03b8bd4e72b12bc5 (diff)
downloadprosody-71960dbef32583ee4e65cedc57faac5a11638d6a.tar.gz
prosody-71960dbef32583ee4e65cedc57faac5a11638d6a.zip
mod_bosh: Fix for miscalculating inactivity, causing disconnects under a steady stream of traffic
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bosh.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index 58254169..b9152c9f 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -125,6 +125,12 @@ function handle_request(method, body, request)
local session = sessions[request.sid];
if session then
+ -- Session was marked as inactive, since we have
+ -- a request open now, unmark it
+ if inactive_sessions[session] then
+ inactive_sessions[session] = nil;
+ end
+
local r = session.requests;
log("debug", "Session %s has %d out of %d requests open", request.sid, #r, session.bosh_hold);
log("debug", "and there are %d things in the send_buffer", #session.send_buffer);
@@ -154,11 +160,6 @@ function handle_request(method, body, request)
request.reply_before = os_time() + session.bosh_wait;
waiting_requests[request] = true;
end
- if inactive_sessions[session] then
- -- Session was marked as inactive, since we have
- -- a request open now, unmark it
- inactive_sessions[session] = nil;
- end
end
return true; -- Inform httpserver we shall reply later