Comparison

core/sessionmanager.lua @ 1290:c253905a8a55

sessionmanager: It's username@host, not host@username :)
author Matthew Wild <mwild1@gmail.com>
date Tue, 02 Jun 2009 19:08:36 +0100
parent 1226:3b5f9dac2045
child 1301:d10d84f755b5
comparison
equal deleted inserted replaced
1289:d0c38cac1687 1290:c253905a8a55
103 --FIXME: Randomly-generated resources must be unique per-user, and never conflict with existing 103 --FIXME: Randomly-generated resources must be unique per-user, and never conflict with existing
104 104
105 if not hosts[session.host].sessions[session.username] then 105 if not hosts[session.host].sessions[session.username] then
106 local sessions = { sessions = {} }; 106 local sessions = { sessions = {} };
107 hosts[session.host].sessions[session.username] = sessions; 107 hosts[session.host].sessions[session.username] = sessions;
108 bare_sessions[session.host..'@'..session.username] = sessions; 108 bare_sessions[session.username..'@'..session.host] = sessions;
109 else 109 else
110 local sessions = hosts[session.host].sessions[session.username].sessions; 110 local sessions = hosts[session.host].sessions[session.username].sessions;
111 local limit = config_get(session.host, "core", "max_resources") or 10; 111 local limit = config_get(session.host, "core", "max_resources") or 10;
112 if #sessions >= limit then 112 if #sessions >= limit then
113 return nil, "cancel", "conflict", "Resource limit reached; only "..limit.." resources allowed"; 113 return nil, "cancel", "conflict", "Resource limit reached; only "..limit.." resources allowed";