# HG changeset patch # User Matthew Wild # Date 1227071497 0 # Node ID cae2178b56234362a4b9562b01bd5df4fd85ff24 # Parent 52f75260a22d859a390ff7490a654230bd571c46 Log sent s2s stanzas diff -r 52f75260a22d -r cae2178b5623 core/s2smanager.lua --- a/core/s2smanager.lua Wed Nov 19 05:10:42 2008 +0000 +++ b/core/s2smanager.lua Wed Nov 19 05:11:37 2008 +0000 @@ -76,8 +76,8 @@ getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; print("s2s session got collected, now "..open_sessions.." s2s sessions are allocated") end; end open_sessions = open_sessions + 1; - local w = conn.write; - session.sends2s = function (t) w(tostring(t)); end + local w, log = conn.write, logger_init("s2sin"..tostring(conn):match("[a-f0-9]+$")); + session.sends2s = function (t) log("debug", "sending: %s", tostring(t)); w(tostring(t)); end return session; end @@ -124,13 +124,15 @@ -- otherwise it will assume it is a new incoming connection cl.register_outgoing(conn, host_session); + local log; do local conn_name = "s2sout"..tostring(conn):match("[a-f0-9]*$"); - host_session.log = logger_init(conn_name); + log = logger_init(conn_name); + host_session.log = log; end local w = conn.write; - host_session.sends2s = function (t) w(tostring(t)); end + host_session.sends2s = function (t) log("debug", "sending: %s", tostring(t)); w(tostring(t)); end conn.write(format([[]], from_host, to_host));