Software /
code /
prosody
Comparison
core/sessionmanager.lua @ 3089:69fb1cb6b551
sessionmanager: Change error for reaching resource limit from 'conflict' to 'resource-constraint' during session bind.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 22 May 2010 05:53:27 +0500 |
parent | 3088:a233aa051125 |
child | 3091:d6a059af2077 |
comparison
equal
deleted
inserted
replaced
3088:a233aa051125 | 3089:69fb1cb6b551 |
---|---|
134 bare_sessions[session.username..'@'..session.host] = sessions; | 134 bare_sessions[session.username..'@'..session.host] = sessions; |
135 else | 135 else |
136 local sessions = hosts[session.host].sessions[session.username].sessions; | 136 local sessions = hosts[session.host].sessions[session.username].sessions; |
137 local limit = config_get(session.host, "core", "max_resources") or 10; | 137 local limit = config_get(session.host, "core", "max_resources") or 10; |
138 if #sessions >= limit then | 138 if #sessions >= limit then |
139 return nil, "cancel", "conflict", "Resource limit reached; only "..limit.." resources allowed"; | 139 return nil, "cancel", "resource-constraint", "Resource limit reached; only "..limit.." resources allowed"; |
140 end | 140 end |
141 if sessions[resource] then | 141 if sessions[resource] then |
142 -- Resource conflict | 142 -- Resource conflict |
143 local policy = config_get(session.host, "core", "conflict_resolve"); | 143 local policy = config_get(session.host, "core", "conflict_resolve"); |
144 local increment; | 144 local increment; |