Comparison

plugins/mod_bosh.lua @ 692:4a218377f4e3

BOSH: Fix for error when closed session was in inactive_sessions list
author Matthew Wild <mwild1@gmail.com>
date Mon, 12 Jan 2009 02:57:49 +0000
parent 684:b7d85c6a0002
child 693:d8b793e612a9
comparison
equal deleted inserted replaced
691:406b070b5d3e 692:4a218377f4e3
238 end 238 end
239 end 239 end
240 240
241 now = now - 3; 241 now = now - 3;
242 for session, inactive_since in pairs(inactive_sessions) do 242 for session, inactive_since in pairs(inactive_sessions) do
243 if now - inactive_since > session.bosh_max_inactive then 243 if session.bosh_max_inactive then
244 (session.log or log)("debug", "BOSH client inactive too long, destroying session at %d", now); 244 if now - inactive_since > session.bosh_max_inactive then
245 sessions[session.sid] = nil; 245 (session.log or log)("debug", "BOSH client inactive too long, destroying session at %d", now);
246 sessions[session.sid] = nil;
247 inactive_sessions[session] = nil;
248 sm_destroy_session(session, "BOSH client silent for over "..session.bosh_max_inactive.." seconds");
249 end
250 elseif not session.type then
246 inactive_sessions[session] = nil; 251 inactive_sessions[session] = nil;
247 sm_destroy_session(session, "BOSH client silent for over "..session.bosh_max_inactive.." seconds");
248 end 252 end
249 end 253 end
250 end 254 end
251 255
252 httpserver.new{ port = 5280, base = "http-bind", handler = handle_request, ssl = false} 256 httpserver.new{ port = 5280, base = "http-bind", handler = handle_request, ssl = false}