aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_s2s.lua')
-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 3710a967..1b40f782 100644
--- a/plugins/mod_s2s.lua
+++ b/plugins/mod_s2s.lua
@@ -958,6 +958,13 @@ end
module:hook("s2s-check-certificate", check_auth_policy, -1);
module:hook("server-stopping", function(event)
+ -- Close ports
+ local pm = require "core.portmanager";
+ for _, netservice in pairs(module.items["net-provider"]) do
+ pm.unregister_service(netservice.name, netservice);
+ end
+
+ -- Close sessions
local reason = event.reason;
for _, session in pairs(sessions) do
session:close{ condition = "system-shutdown", text = reason };