From 064494bbec51f5df79df585abc11009e71e14e86 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 14 Jul 2021 02:39:54 +0200 Subject: 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. --- plugins/mod_s2s.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins/mod_s2s.lua') diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua index f2a7c850..ca06c281 100644 --- a/plugins/mod_s2s.lua +++ b/plugins/mod_s2s.lua @@ -259,6 +259,14 @@ function module.add_host(module) 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 -- cgit v1.2.3