aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2017-07-28 23:45:05 +0100
committerMatthew Wild <mwild1@gmail.com>2017-07-28 23:45:05 +0100
commit8049a9c15fdbf78f0284240ef532e90228e6d4ad (patch)
tree1d06aee2aa04c2cc99f7dbfdec26dd956c570924 /core
parent9c2aad71193849bf605a576b068405b0afe7da0e (diff)
downloadprosody-8049a9c15fdbf78f0284240ef532e90228e6d4ad.tar.gz
prosody-8049a9c15fdbf78f0284240ef532e90228e6d4ad.zip
sessionmanager: Revert session.type if binding fails due to roster load error
Diffstat (limited to 'core')
-rw-r--r--core/sessionmanager.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index f7f36ae3..6c9ecc24 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -187,10 +187,14 @@ local function bind_resource(session, resource)
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;