From a36bf4db9b45fcb5ad8686f32a37ec5a8eeb6eba Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 17 May 2010 11:42:53 +0100 Subject: mod_bosh: Remove requests from the session table using table.remove(), prevents the possibility of holes in the array. --- plugins/mod_bosh.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index 5c77ad46..150d1fd0 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -47,8 +47,11 @@ function on_destroy_request(request) 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 -- cgit v1.2.3