+ 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
+ end
+
+ -- If this session now has no requests open, mark it as inactive
+ if #requests == 0 and session.bosh_max_inactive and not inactive_sessions[session] then
+ inactive_sessions[session] = os_time();
+ (session.log or log)("debug", "BOSH session marked as inactive at %d", inactive_sessions[session]);
+ end
+ end