Software /
code /
prosody
Changeset
791:a4be1d80775c
Fixed: kick_old resource conflict resolution policy could fail with a backtrace
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 12 Feb 2009 18:23:00 +0500 |
parents | 790:f42ad7385640 |
children | 792:57c793b1575f 805:5fbbf34ef1c4 |
files | core/sessionmanager.lua |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/core/sessionmanager.lua Thu Feb 12 18:09:17 2009 +0500 +++ b/core/sessionmanager.lua Thu Feb 12 18:23:00 2009 +0500 @@ -126,10 +126,13 @@ elseif policy == "kick_new" then return nil, "cancel", "conflict", "Resource already exists"; else -- if policy == "kick_old" then - hosts[session.host].sessions[session.username].sessions[resource]:close { + sessions[resource]:close { condition = "conflict"; text = "Replaced by new connection"; }; + if not next(sessions) then + hosts[session.host].sessions[session.username] = { sessions = sessions }; + end end if increment and sessions[resource] then local count = 1;