364 session.streamid = uuid_gen(); |
364 session.streamid = uuid_gen(); |
365 (session.log or log)("debug", "incoming s2s received <stream:stream>"); |
365 (session.log or log)("debug", "incoming s2s received <stream:stream>"); |
366 send("<?xml version='1.0'?>"); |
366 send("<?xml version='1.0'?>"); |
367 send(stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', |
367 send(stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', |
368 ["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()); |
368 ["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()); |
369 session.notopen = nil; |
|
370 if session.to_host and not hosts[session.to_host] then |
369 if session.to_host and not hosts[session.to_host] then |
371 -- Attempting to connect to a host we don't serve |
370 -- Attempting to connect to a host we don't serve |
372 session:close({ condition = "host-unknown"; text = "This host does not serve "..session.to_host }); |
371 session:close({ condition = "host-unknown"; text = "This host does not serve "..session.to_host }); |
373 return; |
372 return; |
374 end |
373 end |