aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s/mod_s2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-12-28 14:33:47 +0100
committerKim Alvefur <zash@zash.se>2012-12-28 14:33:47 +0100
commit3e2a8fbe1c48e2387ab544da454132cf7c8d5d2c (patch)
tree44b919ba59445e4f92b30ff080456c7eda4e59ad /plugins/mod_s2s/mod_s2s.lua
parentde47f7e8361773e32f8278c6ae305e1a08636285 (diff)
downloadprosody-3e2a8fbe1c48e2387ab544da454132cf7c8d5d2c.tar.gz
prosody-3e2a8fbe1c48e2387ab544da454132cf7c8d5d2c.zip
prosody, mod_c2s, mod_s2s: Move closing of c2s and s2s sessions to respective plugins
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 788a64af..ad628a9b 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -506,6 +506,15 @@ end
s2sout.set_listener(listener);
+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,500);
+
+
+
module:provides("net", {
name = "s2s";
listener = listener;