diff options
author | Kim Alvefur <zash@zash.se> | 2021-07-14 02:39:54 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-07-14 02:39:54 +0200 |
commit | 064494bbec51f5df79df585abc11009e71e14e86 (patch) | |
tree | dec1b217798d114aa8faed271b40d0fdf7562e8a /plugins/mod_s2s.lua | |
parent | 9298e3ba8aafcf415f126240ebf0795975cb0b8f (diff) | |
download | prosody-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/mod_s2s.lua')
-rw-r--r-- | plugins/mod_s2s.lua | 8 |
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 |