aboutsummaryrefslogtreecommitdiffstats
path: root/core/s2smanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-12-17 21:17:47 +0000
committerMatthew Wild <mwild1@gmail.com>2009-12-17 21:17:47 +0000
commitf81d945625dd9afada0438b6177c5570bdf1dd45 (patch)
tree283b32c31ac45944e0c852579ea3e3e3461c862f /core/s2smanager.lua
parent8f271c3a7e8dc058cb3567012549a86daadfee2e (diff)
downloadprosody-f81d945625dd9afada0438b6177c5570bdf1dd45.tar.gz
prosody-f81d945625dd9afada0438b6177c5570bdf1dd45.zip
s2smanager: Mark stream as opened sooner, this prevents a duplicated stream header on host-unknown errors (thanks darkrain and his mail server)
Diffstat (limited to 'core/s2smanager.lua')
-rw-r--r--core/s2smanager.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 2ea645fb..1d1e4696 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -366,6 +366,7 @@ function streamopened(session, attr)
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());
+ session.notopen = nil;
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 });
@@ -412,8 +413,6 @@ function streamopened(session, attr)
end
end
end
-
- session.notopen = nil;
end
function streamclosed(session)