Mercurial > prosody-hg
comparison plugins/mod_s2s/s2sout.lib.lua @ 6258:8a01bce29834
Merge 0.10->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 24 May 2014 01:27:09 +0200 |
| parents | d05627c89c99 |
| children | 855085439f7f |
comparison
equal
deleted
inserted
replaced
| 6254:da4c04df90e3 | 6258:8a01bce29834 |
|---|---|
| 295 end | 295 end |
| 296 | 296 |
| 297 conn = wrapclient(conn, connect_host.addr, connect_port, s2s_listener, "*a"); | 297 conn = wrapclient(conn, connect_host.addr, connect_port, s2s_listener, "*a"); |
| 298 host_session.conn = conn; | 298 host_session.conn = conn; |
| 299 | 299 |
| 300 local filter = initialize_filters(host_session); | |
| 301 local w, log = conn.write, host_session.log; | |
| 302 host_session.sends2s = function (t) | |
| 303 log("debug", "sending: %s", (t.top_tag and t:top_tag()) or t:match("^[^>]*>?")); | |
| 304 if t.name then | |
| 305 t = filter("stanzas/out", t); | |
| 306 end | |
| 307 if t then | |
| 308 t = filter("bytes/out", tostring(t)); | |
| 309 if t then | |
| 310 return w(conn, tostring(t)); | |
| 311 end | |
| 312 end | |
| 313 end | |
| 314 | |
| 315 -- Register this outgoing connection so that xmppserver_listener knows about it | 300 -- Register this outgoing connection so that xmppserver_listener knows about it |
| 316 -- otherwise it will assume it is a new incoming connection | 301 -- otherwise it will assume it is a new incoming connection |
| 317 s2s_listener.register_outgoing(conn, host_session); | 302 s2s_listener.register_outgoing(conn, host_session); |
| 318 | 303 |
| 319 log("debug", "Connection attempt in progress..."); | 304 log("debug", "Connection attempt in progress..."); |
