diff options
author | Kim Alvefur <zash@zash.se> | 2021-12-18 12:50:53 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-12-18 12:50:53 +0100 |
commit | 3fe05657e35bcf358356dbdaf186af430d190f90 (patch) | |
tree | 9c993bdef0b7c77ef4a9f559181e8809d3582c7d | |
parent | 585a1aa0c643cdd955ed38fcbd7aebdee11d43c5 (diff) | |
download | prosody-3fe05657e35bcf358356dbdaf186af430d190f90.tar.gz prosody-3fe05657e35bcf358356dbdaf186af430d190f90.zip |
mod_smacks: Remove references to connection on hibernation
Still having the connection on the session may cause unintentional
behavior, such as the session being treated as if connected, even tho
the connection has been closed.
-rw-r--r-- | plugins/mod_smacks.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua index b4a0057d..1f1ebd7d 100644 --- a/plugins/mod_smacks.lua +++ b/plugins/mod_smacks.lua @@ -440,7 +440,10 @@ module:hook("pre-resource-unbind", function (event) sessionmanager.destroy_session(session, "Hibernating too long"); end); if session.conn then - session.conn:close(); + local conn = session.conn; + c2s_sessions[conn] = nil; + session.conn = nil; + conn:close(); end module:fire_event("smacks-hibernation-start", { origin = session; queue = session.outgoing_stanza_queue:table() }); return true; -- Postpone destruction for now |