aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-12-17 21:36:31 +0000
committerMatthew Wild <mwild1@gmail.com>2009-12-17 21:36:31 +0000
commit8c41e630056a2d94786df8311161f779527abcf2 (patch)
tree5b2e1925f874de74801a4f86b9b09db616fca0a6 /core
parent6aaad6c768a9e5787facd78984d6a906b17af4f1 (diff)
downloadprosody-8c41e630056a2d94786df8311161f779527abcf2.tar.gz
prosody-8c41e630056a2d94786df8311161f779527abcf2.zip
s2smanager: Send reply stream header only after checking we serve this host (sorry darkrain... :) )
Diffstat (limited to 'core')
-rw-r--r--core/s2smanager.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 2ea645fb..110d768b 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -363,17 +363,17 @@ function streamopened(session, attr)
session.streamid = uuid_gen();
(session.log or log)("debug", "incoming s2s received <stream:stream>");
- send("<?xml version='1.0'?>");
- send(stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback',
- ["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=session.to_host, version=(session.version > 0 and "1.0" or nil) }):top_tag());
if session.to_host and not hosts[session.to_host] then
-- Attempting to connect to a host we don't serve
session:close({ condition = "host-unknown"; text = "This host does not serve "..session.to_host });
return;
end
+ send("<?xml version='1.0'?>");
+ send(stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback',
+ ["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=session.to_host, version=(session.version > 0 and "1.0" or nil) }):top_tag());
if session.version >= 1.0 then
local features = st.stanza("stream:features");
-
+
if session.to_host then
hosts[session.to_host].events.fire_event("s2s-stream-features", { session = session, features = features });
else