diff options
author | Kim Alvefur <zash@zash.se> | 2022-02-11 21:41:04 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-02-11 21:41:04 +0100 |
commit | 14a7fdb2a84dcc7ba07c54ae3613c11f91da4720 (patch) | |
tree | e81e72b5671c3fbe05c7ea12acad8f9ff4e87b9f /plugins/mod_s2s.lua | |
parent | f56aaf1ba149176fe65254960cba957843c4ca10 (diff) | |
download | prosody-14a7fdb2a84dcc7ba07c54ae3613c11f91da4720.tar.gz prosody-14a7fdb2a84dcc7ba07c54ae3613c11f91da4720.zip |
mod_s2s: Disable creation of new outgoing connections during shutdown
Diffstat (limited to 'plugins/mod_s2s.lua')
-rw-r--r-- | plugins/mod_s2s.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua index 1b40f782..4b721237 100644 --- a/plugins/mod_s2s.lua +++ b/plugins/mod_s2s.lua @@ -964,6 +964,13 @@ module:hook("server-stopping", function(event) pm.unregister_service(netservice.name, netservice); end + -- Stop opening new connections + for host in pairs(prosody.hosts) do + if prosody.hosts[host].modules.s2s then + module:context(host):unhook("route/remote", route_to_new_session); + end + end + -- Close sessions local reason = event.reason; for _, session in pairs(sessions) do |