Merge 0.8->trunk
[prosody.git] / plugins / mod_bosh.lua
index c2c7eae98d1b7174f749d2291b421d3a1b1f2a5b..a6b84367a392703956f2886d6589f1f2a944682d 100644 (file)
@@ -125,11 +125,11 @@ function handle_request(method, body, request)
        
        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);