aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_bosh.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2016-09-02 23:25:11 +0100
committerMatthew Wild <mwild1@gmail.com>2016-09-02 23:25:11 +0100
commit7793746f3e887ddab96e506705f86738ba042281 (patch)
tree84d9fa03d3439f4564c62053ae05c94b37c520b0 /plugins/mod_bosh.lua
parent96e00dbde16467b681555003ed352c6d31a9c6e0 (diff)
downloadprosody-7793746f3e887ddab96e506705f86738ba042281.tar.gz
prosody-7793746f3e887ddab96e506705f86738ba042281.zip
mod_bosh: Update BOSH wait timeout logic to work despite the addition of deferred requests
Diffstat (limited to 'plugins/mod_bosh.lua')
-rw-r--r--plugins/mod_bosh.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index 39d5a8be..1a5d3904 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -197,9 +197,6 @@ function handle_POST(event)
if not response.finished then
-- We're keeping this request open, to respond later
log("debug", "Have nothing to say, so leaving request unanswered for now");
- if session.bosh_wait then
- session.bosh_wait_timer = module:add_timer(session.bosh_wait, after_bosh_wait, request, session)
- end
end
if session.bosh_terminate then
@@ -207,6 +204,10 @@ function handle_POST(event)
session:close();
return nil;
else
+ if session.bosh_wait and #session.requests > 0 then
+ session.bosh_wait_timer = module:add_timer(session.bosh_wait, after_bosh_wait, session.requests[1], session)
+ end
+
return true; -- Inform http server we shall reply later
end
elseif response.finished then