aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-02-11 21:41:04 +0100
committerKim Alvefur <zash@zash.se>2022-02-11 21:41:04 +0100
commit14a7fdb2a84dcc7ba07c54ae3613c11f91da4720 (patch)
treee81e72b5671c3fbe05c7ea12acad8f9ff4e87b9f
parentf56aaf1ba149176fe65254960cba957843c4ca10 (diff)
downloadprosody-14a7fdb2a84dcc7ba07c54ae3613c11f91da4720.tar.gz
prosody-14a7fdb2a84dcc7ba07c54ae3613c11f91da4720.zip
mod_s2s: Disable creation of new outgoing connections during shutdown
-rw-r--r--plugins/mod_s2s.lua7
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