# HG changeset patch # User Waqas Hussain # Date 1234444980 -18000 # Node ID a4be1d80775c4f9cfb65d8b6890356cdf7577126 # Parent f42ad7385640f2171daeaebce7a78e8e13d040c5 Fixed: kick_old resource conflict resolution policy could fail with a backtrace diff -r f42ad7385640 -r a4be1d80775c core/sessionmanager.lua --- 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;