Mon, 17 May 2010 11:42:53 +0100
mod_bosh: Remove requests from the session table using table.remove(), prevents the possibility of holes in the array.
plugins/mod_bosh.lua | file | annotate | diff | comparison | revisions |
--- a/plugins/mod_bosh.lua Fri May 07 16:10:04 2010 +0500 +++ b/plugins/mod_bosh.lua Mon May 17 11:42:53 2010 +0100 @@ -47,8 +47,11 @@ local session = sessions[request.sid]; if session then local requests = session.requests; - for i,r in pairs(requests) do - if r == request then requests[i] = nil; break; end + for i,r in ipairs(requests) do + if r == request then + t_remove(requests, i); + break; + end end -- If this session now has no requests open, mark it as inactive