comparison mod_smacks/mod_smacks.lua @ 987:fabff75bfc3f

mod_smacks: If a hibernating session was destroyed before the timeout, don't destroy it again or say that it was resumed
author Kim Alvefur <zash@zash.se>
date Thu, 25 Apr 2013 17:34:30 +0200
parents 720b8268778e
children c15cea87036f
comparison
equal deleted inserted replaced
986:8b1250df82e8 987:fabff75bfc3f
228 -- We need to check the current resumption token for this resource 228 -- We need to check the current resumption token for this resource
229 -- matches the smacks session this timer is for in case it changed 229 -- matches the smacks session this timer is for in case it changed
230 -- (for example, the client may have bound a new resource and 230 -- (for example, the client may have bound a new resource and
231 -- started a new smacks session, or not be using smacks) 231 -- started a new smacks session, or not be using smacks)
232 local curr_session = full_sessions[session.full_jid]; 232 local curr_session = full_sessions[session.full_jid];
233 if curr_session and curr_session.resumption_token == resumption_token 233 if false and session.destroyed then
234 session.log("debug", "The session has already been destroyed");
235 elseif curr_session and curr_session.resumption_token == resumption_token
234 -- Check the hibernate time still matches what we think it is, 236 -- Check the hibernate time still matches what we think it is,
235 -- otherwise the session resumed and re-hibernated. 237 -- otherwise the session resumed and re-hibernated.
236 and session.hibernating == hibernate_time then 238 and session.hibernating == hibernate_time then
237 session.log("debug", "Destroying session for hibernating too long"); 239 session.log("debug", "Destroying session for hibernating too long");
238 session_registry[session.resumption_token] = nil; 240 session_registry[session.resumption_token] = nil;