347 cl.register_outgoing(conn, host_session); |
347 cl.register_outgoing(conn, host_session); |
348 |
348 |
349 local filter = initialize_filters(host_session); |
349 local filter = initialize_filters(host_session); |
350 local w, log = conn.write, host_session.log; |
350 local w, log = conn.write, host_session.log; |
351 host_session.sends2s = function (t) |
351 host_session.sends2s = function (t) |
|
352 log("debug", "sending: %s", (t.top_tag and t:top_tag()) or t:match("^[^>]*>?")); |
352 if t.name then |
353 if t.name then |
353 t = filter("stanzas/out", t); |
354 t = filter("stanzas/out", t); |
354 end |
355 end |
355 if t then |
356 if t then |
356 t = filter("bytes/out", tostring(t)); |
357 t = filter("bytes/out", tostring(t)); |
357 if t then |
358 if t then |
358 log("debug", "sending: %s", (t.top_tag and t:top_tag()) or t:match("^[^>]*>?")); |
|
359 return w(conn, tostring(t)); |
359 return w(conn, tostring(t)); |
360 end |
360 end |
361 end |
361 end |
362 end |
362 end |
363 |
363 |