Diff

core/s2smanager.lua @ 2377:78c5cb163ea9

s2smanager: Mark stream as opened sooner, this prevents a duplicated stream header on host-unknown errors (thanks darkrain and his mail server)
author Matthew Wild <mwild1@gmail.com>
date Thu, 17 Dec 2009 21:17:47 +0000
parent 2376:c5faafa89f50
child 2378:bc1ae371ad54
child 2379:66ba153d3f09
line wrap: on
line diff
--- a/core/s2smanager.lua	Thu Dec 17 21:14:44 2009 +0000
+++ b/core/s2smanager.lua	Thu Dec 17 21:17:47 2009 +0000
@@ -366,6 +366,7 @@
 		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 @@
 			end
 		end
 	end
-
-	session.notopen = nil;
 end
 
 function streamclosed(session)