aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-07-14 02:39:54 +0200
committerKim Alvefur <zash@zash.se>2021-07-14 02:39:54 +0200
commit064494bbec51f5df79df585abc11009e71e14e86 (patch)
treedec1b217798d114aa8faed271b40d0fdf7562e8a /plugins
parent9298e3ba8aafcf415f126240ebf0795975cb0b8f (diff)
downloadprosody-064494bbec51f5df79df585abc11009e71e14e86.tar.gz
prosody-064494bbec51f5df79df585abc11009e71e14e86.zip
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_s2s.lua8
1 files changed, 8 insertions, 0 deletions
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