# HG changeset patch # User Kim Alvefur # Date 1626223194 -7200 # Node ID 41b144a93897c64663d3f14c066dea1e41eab270 # Parent 7843f1ca3b332336a6c18d093bdff5a428243196 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. diff -r 7843f1ca3b33 -r 41b144a93897 plugins/mod_s2s.lua --- 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