Software /
code /
prosody
Diff
plugins/mod_bosh.lua @ 7656:296543556065
mod_bosh: Update BOSH wait timeout logic to work despite the addition of deferred requests
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 02 Sep 2016 23:25:11 +0100 |
parent | 7655:132819f409dc |
child | 7660:d2825ddaac19 |
line wrap: on
line diff
--- a/plugins/mod_bosh.lua Fri Sep 02 23:24:40 2016 +0100 +++ b/plugins/mod_bosh.lua Fri Sep 02 23:25:11 2016 +0100 @@ -197,9 +197,6 @@ 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 @@ 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