Comparison

core/sessionmanager.lua @ 4263:618e2a2b2d2c

sessionmanager: Log reason when destroying a session.
author Waqas Hussain <waqas20@gmail.com>
date Sat, 07 May 2011 21:15:34 +0500
parent 4230:23b68616b6d8
child 4325:fb35ccf391af
comparison
equal deleted inserted replaced
4262:fd4d1cf6d63e 4263:618e2a2b2d2c
101 function session.data(data) log("debug", "Discarding data received from resting session: %s", tostring(data)); end 101 function session.data(data) log("debug", "Discarding data received from resting session: %s", tostring(data)); end
102 return setmetatable(session, resting_session); 102 return setmetatable(session, resting_session);
103 end 103 end
104 104
105 function destroy_session(session, err) 105 function destroy_session(session, err)
106 (session.log or log)("info", "Destroying session for %s (%s@%s)", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)"); 106 (session.log or log)("info", "Destroying session for %s (%s@%s)%s", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)", err and (": "..err) or "");
107 if session.destroyed then return; end 107 if session.destroyed then return; end
108 108
109 -- Remove session/resource from user's session list 109 -- Remove session/resource from user's session list
110 if session.full_jid then 110 if session.full_jid then
111 local host_session = hosts[session.host]; 111 local host_session = hosts[session.host];