diff options
author | Kim Alvefur <zash@zash.se> | 2013-06-11 21:18:51 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2013-06-11 21:18:51 +0200 |
commit | 6af157e1f8bafe7dec7adf3b0834314fd79d0b39 (patch) | |
tree | 9275dedd110a4031014dc3da8f93ee1201914e59 /plugins/mod_c2s.lua | |
parent | 296d4f627c333063728d6bdedd4ff67568393de4 (diff) | |
download | prosody-6af157e1f8bafe7dec7adf3b0834314fd79d0b39.tar.gz prosody-6af157e1f8bafe7dec7adf3b0834314fd79d0b39.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.lua | 4 |
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 |