Software /
code /
prosody
Comparison
core/sessionmanager.lua @ 3088:a233aa051125
sessionmanager: If roster loading fails during resource bind, kick the user with an internal-server-error.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 22 May 2010 05:52:24 +0500 |
parent | 2925:692b3c6c5bd2 |
child | 3089:69fb1cb6b551 |
comparison
equal
deleted
inserted
replaced
3087:9b31e36528e0 | 3088:a233aa051125 |
---|---|
172 session.resource = resource; | 172 session.resource = resource; |
173 session.full_jid = session.username .. '@' .. session.host .. '/' .. resource; | 173 session.full_jid = session.username .. '@' .. session.host .. '/' .. resource; |
174 hosts[session.host].sessions[session.username].sessions[resource] = session; | 174 hosts[session.host].sessions[session.username].sessions[resource] = session; |
175 full_sessions[session.full_jid] = session; | 175 full_sessions[session.full_jid] = session; |
176 | 176 |
177 session.roster = rm_load_roster(session.username, session.host); | 177 local err; |
178 session.roster, err = rm_load_roster(session.username, session.host); | |
179 if err then | |
180 full_sessions[session.full_jid] = nil; | |
181 hosts[session.host].sessions[session.username].sessions[resource] = nil; | |
182 session.full_jid = nil; | |
183 session.resource = nil; | |
184 if next(bare_sessions[session.username..'@'..session.host]) == nil then | |
185 bare_sessions[session.username..'@'..session.host] = nil; | |
186 hosts[session.host].sessions[session.username] = nil; | |
187 end | |
188 return nil, "cancel", "internal-server-error", "Error loading roster"; | |
189 end | |
178 | 190 |
179 hosts[session.host].events.fire_event("resource-bind", {session=session}); | 191 hosts[session.host].events.fire_event("resource-bind", {session=session}); |
180 | 192 |
181 return true; | 193 return true; |
182 end | 194 end |