Comparison

core/sessionmanager.lua @ 4813:77da9671ac39

sessionmanager: Remove max_resources config option and check, incorrect anyway (thanks Zash)
author Matthew Wild <mwild1@gmail.com>
date Thu, 03 May 2012 23:18:56 +0100
parent 4552:414d857ee125
child 4961:29b24a4028ed
comparison
equal deleted inserted replaced
4812:5bcdc384e485 4813:77da9671ac39
141 local sessions = { sessions = {} }; 141 local sessions = { sessions = {} };
142 hosts[session.host].sessions[session.username] = sessions; 142 hosts[session.host].sessions[session.username] = sessions;
143 bare_sessions[session.username..'@'..session.host] = sessions; 143 bare_sessions[session.username..'@'..session.host] = sessions;
144 else 144 else
145 local sessions = hosts[session.host].sessions[session.username].sessions; 145 local sessions = hosts[session.host].sessions[session.username].sessions;
146 local limit = config_get(session.host, "core", "max_resources") or 10;
147 if #sessions >= limit then
148 return nil, "cancel", "resource-constraint", "Resource limit reached; only "..limit.." resources allowed";
149 end
150 if sessions[resource] then 146 if sessions[resource] then
151 -- Resource conflict 147 -- Resource conflict
152 local policy = config_get(session.host, "core", "conflict_resolve"); 148 local policy = config_get(session.host, "core", "conflict_resolve");
153 local increment; 149 local increment;
154 if policy == "random" then 150 if policy == "random" then