Changeset

12299:ff36ac5c7d2b

mod_s2s: Disable creation of new outgoing connections during shutdown
author Kim Alvefur <zash@zash.se>
date Fri, 11 Feb 2022 21:41:04 +0100
parents 12298:cb459f8fa740
children 12300:fb74ff16620c
files plugins/mod_s2s.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_s2s.lua	Fri Feb 11 21:36:53 2022 +0100
+++ b/plugins/mod_s2s.lua	Fri Feb 11 21:41:04 2022 +0100
@@ -964,6 +964,13 @@
 		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