aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-05-17 11:42:53 +0100
committerMatthew Wild <mwild1@gmail.com>2010-05-17 11:42:53 +0100
commita36bf4db9b45fcb5ad8686f32a37ec5a8eeb6eba (patch)
tree054b43d8dcb13db1cee456472b4578117eec3133
parentc43b31011fc3d488b33945f64c0362666ca96913 (diff)
downloadprosody-a36bf4db9b45fcb5ad8686f32a37ec5a8eeb6eba.tar.gz
prosody-a36bf4db9b45fcb5ad8686f32a37ec5a8eeb6eba.zip
mod_bosh: Remove requests from the session table using table.remove(), prevents the possibility of holes in the array.
-rw-r--r--plugins/mod_bosh.lua7
1 files changed, 5 insertions, 2 deletions
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