Software /
code /
prosody
Comparison
plugins/mod_bosh.lua @ 947:84202314ab7f
mod_bosh: Fix to correctly timeout idle sessions
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 31 Mar 2009 13:56:41 +0100 |
parent | 866:8958fe4b2391 |
child | 1042:a3d77353c18a |
child | 1047:8c2d88cda1dd |
comparison
equal
deleted
inserted
replaced
946:cf4d9e2d33d1 | 947:84202314ab7f |
---|---|
32 | 32 |
33 -- Used to respond to idle sessions (those with waiting requests) | 33 -- Used to respond to idle sessions (those with waiting requests) |
34 local waiting_requests = {}; | 34 local waiting_requests = {}; |
35 function on_destroy_request(request) | 35 function on_destroy_request(request) |
36 waiting_requests[request] = nil; | 36 waiting_requests[request] = nil; |
37 local session = request.session; | 37 local session = sessions[request.sid]; |
38 if session then | 38 if session then |
39 local requests = session.requests; | 39 local requests = session.requests; |
40 for i,r in pairs(requests) do | 40 for i,r in pairs(requests) do |
41 if r == request then requests[i] = nil; break; end | 41 if r == request then requests[i] = nil; break; end |
42 end | 42 end |