aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_bosh.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-01-12 02:57:49 +0000
committerMatthew Wild <mwild1@gmail.com>2009-01-12 02:57:49 +0000
commitf5412a5f91b0a211bd74f708e417f7a9de2c338f (patch)
tree71e498d82b66a04d2f4c3b01bdfb8c96e4be54fc /plugins/mod_bosh.lua
parent7381cd9804f3a6fa6eaabdf1016115a8c6f8d46c (diff)
downloadprosody-f5412a5f91b0a211bd74f708e417f7a9de2c338f.tar.gz
prosody-f5412a5f91b0a211bd74f708e417f7a9de2c338f.zip
BOSH: Fix for error when closed session was in inactive_sessions list
Diffstat (limited to 'plugins/mod_bosh.lua')
-rw-r--r--plugins/mod_bosh.lua12
1 files 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