mod_bosh: Mark a session as active when a request comes in, even if we don't end up holding that request, fixes BOSH ghosts (thanks smoku)
authorMatthew Wild <mwild1@gmail.com>
Sun, 05 Jun 2011 11:48:57 +0100
changeset 4308 50e1a3dc2b50
parent 4305 e3ffa91517cc
child 4309 7ad81d81f5ec
mod_bosh: Mark a session as active when a request comes in, even if we don't end up holding that request, fixes BOSH ghosts (thanks smoku)
plugins/mod_bosh.lua
--- a/plugins/mod_bosh.lua	Sun Jun 05 01:57:43 2011 +0500
+++ b/plugins/mod_bosh.lua	Sun Jun 05 11:48:57 2011 +0100
@@ -125,11 +125,11 @@
 	
 	local session = sessions[request.sid];
 	if session then
-               -- Session was marked as inactive, since we have
-               -- a request open now, unmark it
-               if inactive_sessions[session] then
-                       inactive_sessions[session] = nil;
-               end
+		-- Session was marked as inactive, since we have
+		-- a request open now, unmark it
+		if inactive_sessions[session] and #session.requests > 0 then
+			inactive_sessions[session] = nil;
+		end
 
 		local r = session.requests;
 		log("debug", "Session %s has %d out of %d requests open", request.sid, #r, session.bosh_hold);