aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-18 12:50:53 +0100
committerKim Alvefur <zash@zash.se>2021-12-18 12:50:53 +0100
commit3fe05657e35bcf358356dbdaf186af430d190f90 (patch)
tree9c993bdef0b7c77ef4a9f559181e8809d3582c7d /plugins
parent585a1aa0c643cdd955ed38fcbd7aebdee11d43c5 (diff)
downloadprosody-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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_smacks.lua5
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