prosody, mod_c2s, mod_s2s: Move closing of c2s and s2s sessions to respective plugins

This commit is contained in:
Kim Alvefur 2012-12-28 14:33:47 +01:00
parent de47f7e836
commit 3e2a8fbe1c
3 changed files with 18 additions and 37 deletions

View file

@ -265,6 +265,15 @@ function listener.associate_session(conn, session)
sessions[conn] = session;
end
module:hook("server-stopping", function(event)
local reason = event.reason;
for _, session in pairs(sessions) do
session:close{ condition = "system-shutdown", text = reason };
end
end, 1000);
module:provides("net", {
name = "c2s";
listener = listener;