Comparison

core/sessionmanager.lua @ 2752:18d8009f06cb

sessionmanager: Don't re-destroy destroyed sessions
author Matthew Wild <mwild1@gmail.com>
date Sun, 14 Mar 2010 02:59:41 +0000
parent 2751:1d7746c3a8c6
child 2915:f47bd0f7e2e6
comparison
equal deleted inserted replaced
2751:1d7746c3a8c6 2752:18d8009f06cb
86 return setmetatable(session, resting_session); 86 return setmetatable(session, resting_session);
87 end 87 end
88 88
89 function destroy_session(session, err) 89 function destroy_session(session, err)
90 (session.log or log)("info", "Destroying session for %s (%s@%s)", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)"); 90 (session.log or log)("info", "Destroying session for %s (%s@%s)", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)");
91 if session.destroyed then return; end
91 92
92 -- Remove session/resource from user's session list 93 -- Remove session/resource from user's session list
93 if session.full_jid then 94 if session.full_jid then
94 hosts[session.host].sessions[session.username].sessions[session.resource] = nil; 95 hosts[session.host].sessions[session.username].sessions[session.resource] = nil;
95 full_sessions[session.full_jid] = nil; 96 full_sessions[session.full_jid] = nil;