Comparison

core/sessionmanager.lua @ 7950:f91e7ec9654e

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Mon, 06 Mar 2017 01:14:32 +0100
parent 7786:b62353e6a8e5
parent 7949:8acc35b5355a
child 8185:e89320b8a789
comparison
equal deleted inserted replaced
7946:c92102fe409b 7950:f91e7ec9654e
3 -- Copyright (C) 2008-2010 Waqas Hussain 3 -- Copyright (C) 2008-2010 Waqas Hussain
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 -- luacheck: globals prosody.full_sessions prosody.bare_sessions
8 9
9 local tostring, setmetatable = tostring, setmetatable; 10 local tostring, setmetatable = tostring, setmetatable;
10 local pairs, next= pairs, next; 11 local pairs, next= pairs, next;
11 12
12 local hosts = hosts; 13 local hosts = hosts;
75 session.thread = { run = function (_, data) return session.data(data) end }; 76 session.thread = { run = function (_, data) return session.data(data) end };
76 return setmetatable(session, resting_session); 77 return setmetatable(session, resting_session);
77 end 78 end
78 79
79 local function destroy_session(session, err) 80 local function destroy_session(session, err)
80 (session.log or log)("debug", "Destroying session for %s (%s@%s)%s", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)", err and (": "..err) or ""); 81 (session.log or log)("debug", "Destroying session for %s (%s@%s)%s",
82 session.full_jid or "(unknown)", session.username or "(unknown)",
83 session.host or "(unknown)", err and (": "..err) or "");
84
81 if session.destroyed then return; end 85 if session.destroyed then return; end
82 86
83 -- Remove session/resource from user's session list 87 -- Remove session/resource from user's session list
84 if session.full_jid then 88 if session.full_jid then
85 local host_session = hosts[session.host]; 89 local host_session = hosts[session.host];