Software /
code /
prosody
Comparison
core/s2smanager.lua @ 1487:66f18c18befa
Merge with main branch.
author | Tobias Markmann <tm@ayena.de> |
---|---|
date | Sun, 05 Jul 2009 19:05:25 +0200 |
parent | 1468:83b297a412a2 |
child | 1492:aaeccebad0f3 |
comparison
equal
deleted
inserted
replaced
1486:3e04efa8af7e | 1487:66f18c18befa |
---|---|
236 local conn, handler = socket.tcp() | 236 local conn, handler = socket.tcp() |
237 | 237 |
238 conn:settimeout(0); | 238 conn:settimeout(0); |
239 local success, err = conn:connect(connect_host, connect_port); | 239 local success, err = conn:connect(connect_host, connect_port); |
240 if not success and err ~= "timeout" then | 240 if not success and err ~= "timeout" then |
241 log("warn", "s2s connect() failed: %s", err); | 241 log("warn", "s2s connect() to %s (%s:%d) failed: %s", host_session.to_host, connect_host, connect_port, err); |
242 return false; | 242 return false; |
243 end | 243 end |
244 | 244 |
245 local cl = connlisteners_get("xmppserver"); | 245 local cl = connlisteners_get("xmppserver"); |
246 conn = wrapclient(conn, connect_host, connect_port, cl, cl.default_mode or 1, hosts[from_host].ssl_ctx, false ); | 246 conn = wrapclient(conn, connect_host, connect_port, cl, cl.default_mode or 1, hosts[from_host].ssl_ctx, false ); |
251 cl.register_outgoing(conn, host_session); | 251 cl.register_outgoing(conn, host_session); |
252 | 252 |
253 local w = conn.write; | 253 local w = conn.write; |
254 host_session.sends2s = function (t) log("debug", "sending: %s", tostring(t)); w(tostring(t)); end | 254 host_session.sends2s = function (t) log("debug", "sending: %s", tostring(t)); w(tostring(t)); end |
255 | 255 |
256 conn.write(format([[<stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback' xmlns:stream='http://etherx.jabber.org/streams' from='%s' to='%s' version='1.0'>]], from_host, to_host)); | 256 conn.write(format([[<stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback' xmlns:stream='http://etherx.jabber.org/streams' from='%s' to='%s' version='1.0' xml:lang='en'>]], from_host, to_host)); |
257 log("debug", "Connection attempt in progress..."); | 257 log("debug", "Connection attempt in progress..."); |
258 return true; | 258 return true; |
259 end | 259 end |
260 | 260 |
261 function streamopened(session, attr) | 261 function streamopened(session, attr) |