# HG changeset patch # User Matthew Wild # Date 1501281905 -3600 # Node ID dbcae15b4282c23163b9a1e6b0c760f3d41d94b5 # Parent 49a682d6b427df0f0d2676d7d45fbbab24f2124e sessionmanager: Revert session.type if binding fails due to roster load error diff -r 49a682d6b427 -r dbcae15b4282 core/sessionmanager.lua --- a/core/sessionmanager.lua Sun Jul 16 19:25:29 2017 +0100 +++ b/core/sessionmanager.lua Fri Jul 28 23:45:05 2017 +0100 @@ -187,10 +187,14 @@ local err; session.roster, err = rm_load_roster(session.username, session.host); if err then + -- FIXME: Why is all this rollback down here, instead of just doing the roster test up above? full_sessions[session.full_jid] = nil; hosts[session.host].sessions[session.username].sessions[resource] = nil; session.full_jid = nil; session.resource = nil; + if session.type == "c2s" then + session.type = "c2s_unbound"; + end if next(bare_sessions[session.username..'@'..session.host].sessions) == nil then bare_sessions[session.username..'@'..session.host] = nil; hosts[session.host].sessions[session.username] = nil;