aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_c2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-06-11 21:18:51 +0200
committerKim Alvefur <zash@zash.se>2013-06-11 21:18:51 +0200
commitb6ecf01333bcb773beb784e2be93af305dd1cf01 (patch)
tree9275dedd110a4031014dc3da8f93ee1201914e59 /plugins/mod_c2s.lua
parent87170a4fde14e43ed61bddd045642d96a77f47c4 (diff)
downloadprosody-b6ecf01333bcb773beb784e2be93af305dd1cf01.tar.gz
prosody-b6ecf01333bcb773beb784e2be93af305dd1cf01.zip
mod_c2s: Become a shared module and allow being disabled on some virtualhosts
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r--plugins/mod_c2s.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index f9a270c7..d87b3415 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -50,7 +50,7 @@ function stream_callbacks.streamopened(session, attr)
session.streamid = uuid_generate();
(session.log or session)("debug", "Client sent opening <stream:stream> to %s", session.host);
- if not hosts[session.host] then
+ if not hosts[session.host] or not hosts[session.host].modules.c2s then
-- We don't serve this host...
session:close{ condition = "host-unknown", text = "This server does not serve "..tostring(session.host)};
return;
@@ -273,6 +273,8 @@ function listener.associate_session(conn, session)
sessions[conn] = session;
end
+function module.add_host() end
+
module:hook("server-stopping", function(event)
local reason = event.reason;
for _, session in pairs(sessions) do