From f5412a5f91b0a211bd74f708e417f7a9de2c338f Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 12 Jan 2009 02:57:49 +0000 Subject: BOSH: Fix for error when closed session was in inactive_sessions list --- plugins/mod_bosh.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index d41cc02e..2fa73fa3 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -240,11 +240,15 @@ function on_timer() now = now - 3; for session, inactive_since in pairs(inactive_sessions) do - if now - inactive_since > session.bosh_max_inactive then - (session.log or log)("debug", "BOSH client inactive too long, destroying session at %d", now); - sessions[session.sid] = nil; + if session.bosh_max_inactive then + if now - inactive_since > session.bosh_max_inactive then + (session.log or log)("debug", "BOSH client inactive too long, destroying session at %d", now); + sessions[session.sid] = nil; + inactive_sessions[session] = nil; + sm_destroy_session(session, "BOSH client silent for over "..session.bosh_max_inactive.." seconds"); + end + elseif not session.type then inactive_sessions[session] = nil; - sm_destroy_session(session, "BOSH client silent for over "..session.bosh_max_inactive.." seconds"); end end end -- cgit v1.2.3