comparison mod_graceful_shutdown/mod_graceful_shutdown.lua @ 4893:d4ce29c772ac

mod_graceful_shutdown: Close multiplex ports Another way clients might reconnect before the restart has been completed
author Kim Alvefur <zash@zash.se>
date Fri, 11 Feb 2022 16:13:09 +0100
parents 8dbaa5e753f3
children
comparison
equal deleted inserted replaced
4892:8dbaa5e753f3 4893:d4ce29c772ac
21 -- Close c2s ports, stop accepting new connections 21 -- Close c2s ports, stop accepting new connections
22 portman.deactivate("c2s"); 22 portman.deactivate("c2s");
23 portman.deactivate("legacy_ssl"); 23 portman.deactivate("legacy_ssl");
24 portman.deactivate("c2s_direct_tls"); 24 portman.deactivate("c2s_direct_tls");
25 25
26 -- Close multiplexing ports to ensure c2s is not reachable via those either
27 portman.deactivate("multiplex");
28 portman.deactivate("multiplex_ssl");
29 portman.deactivate("proxy"); -- mod_net_proxy
30
26 -- Close all c2s sessions 31 -- Close all c2s sessions
27 for _, sess in pairs(prosody.full_sessions) do 32 for _, sess in pairs(prosody.full_sessions) do
28 sess:close{ condition = "system-shutdown", text = reason } 33 sess:close{ condition = "system-shutdown", text = reason }
29 end 34 end
30 -- Wait for notifications to be sent 35 -- Wait for notifications to be sent