mod_smacks: Ensure hibernating session is not connected
authorKim Alvefur <zash@zash.se>
Thu, 02 Dec 2021 03:03:44 +0100
changeset 11986 c7c0c40487e2
parent 11985 5d8264f464a2
child 11987 27f2539b4f87
mod_smacks: Ensure hibernating session is not connected Turns out that if you destroy a session from inside prosody, it goes into hibernation but stays connected and continues processing stanzas.
plugins/mod_smacks.lua
--- a/plugins/mod_smacks.lua	Wed Dec 01 23:18:18 2021 +0100
+++ b/plugins/mod_smacks.lua	Thu Dec 02 03:03:44 2021 +0100
@@ -514,6 +514,9 @@
 					session.log("debug", "Session resumed before hibernation timeout, all is well")
 				end
 			end);
+			if session.conn then
+				session.conn:close();
+			end
 			return true; -- Postpone destruction for now
 		end
 	end