diff options
author | Matthew Wild <mwild1@gmail.com> | 2023-02-09 22:34:05 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2023-02-09 22:34:05 +0000 |
commit | 8bc31437bc1431ca13f1f96e3ddf52633fa99303 (patch) | |
tree | c6cc95b9fe12aae7031411e5ed3c17f8ee4d6d4c | |
parent | 1ea488deee6ed0d90693088c5f22354c53f878f5 (diff) | |
parent | a4556fc67aa2036bc0f7d95d5f61ba7e95412304 (diff) | |
download | prosody-8bc31437bc1431ca13f1f96e3ddf52633fa99303.tar.gz prosody-8bc31437bc1431ca13f1f96e3ddf52633fa99303.zip |
Merge 0.12->trunk
-rw-r--r-- | core/sessionmanager.lua | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 14c85425..509568c6 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -138,10 +138,6 @@ local function update_session(to_session, from_session) end local function destroy_session(session, err) - (session.log or log)("debug", "Destroying session for %s (%s@%s)%s", - session.full_jid or "(unknown)", session.username or "(unknown)", - session.host or "(unknown)", err and (": "..err) or ""); - if session.destroyed then return; end -- Remove session/resource from user's session list @@ -150,9 +146,16 @@ local function destroy_session(session, err) -- Allow plugins to prevent session destruction if host_session.events.fire_event("pre-resource-unbind", {session=session, error=err}) then + (session.log or log)("debug", "Resource unbind prevented by module"); return; end + (session.log or log)("debug", "Unbinding resource for %s (%s@%s)%s", + session.full_jid or "(unknown)", session.username or "(unknown)", + session.host or "(unknown)", err and (": "..err) or ""); + + session.destroyed = true; -- Past this point the session is DOOMED! + host_session.sessions[session.username].sessions[session.resource] = nil; full_sessions[session.full_jid] = nil; @@ -163,6 +166,10 @@ local function destroy_session(session, err) end host_session.events.fire_event("resource-unbind", {session=session, error=err}); + else + (session.log or log)("debug", "Destroying unbound session for <%s@%s>%s", + session.username or "(unknown)", session.host or "(unknown)", + err and (": "..err) or ""); end retire_session(session); |