138 open_sessions = open_sessions + 1; |
138 open_sessions = open_sessions + 1; |
139 local w, log = conn.write, logger_init("s2sin"..tostring(conn):match("[a-f0-9]+$")); |
139 local w, log = conn.write, logger_init("s2sin"..tostring(conn):match("[a-f0-9]+$")); |
140 session.log = log; |
140 session.log = log; |
141 local filter = initialize_filters(session); |
141 local filter = initialize_filters(session); |
142 session.sends2s = function (t) |
142 session.sends2s = function (t) |
|
143 log("debug", "sending: %s", t.top_tag and t:top_tag() or t:match("^([^>]*>?)")); |
143 if t.name then |
144 if t.name then |
144 t = filter("stanzas/out", t); |
145 t = filter("stanzas/out", t); |
145 end |
146 end |
146 if t then |
147 if t then |
147 t = filter("bytes/out", tostring(t)); |
148 t = filter("bytes/out", tostring(t)); |
148 if t then |
149 if t then |
149 log("debug", "sending: %s", t.top_tag and t:top_tag() or t:match("^([^>]*>?)")); |
|
150 return w(conn, t); |
150 return w(conn, t); |
151 end |
151 end |
152 end |
152 end |
153 end |
153 end |
154 incoming_s2s[session] = true; |
154 incoming_s2s[session] = true; |