Diff

plugins/mod_s2s.lua @ 11683:41b144a93897

mod_s2s: Close connections attached to a host being deactivated Couldn't use those with the host being deactivated. Problem: This kicks in on reload, which isn't needed.
author Kim Alvefur <zash@zash.se>
date Wed, 14 Jul 2021 02:39:54 +0200
parent 11682:7843f1ca3b33
child 11684:8b0baf3003fb
line wrap: on
line diff
--- a/plugins/mod_s2s.lua	Wed Jul 14 02:41:15 2021 +0200
+++ b/plugins/mod_s2s.lua	Wed Jul 14 02:39:54 2021 +0200
@@ -259,6 +259,14 @@
 			return true;
 		end
 	end, -1);
+
+	function module.unload()
+		for _, session in pairs(sessions) do
+			if session.to_host == module.host or session.from_host == module.host then
+				session:close("host-gone");
+			end
+		end
+	end
 end
 
 -- Stream is authorised, and ready for normal stanzas