Comparison

core/sessionmanager.lua @ 9062:1b272b51ae0f

sessionmanager: Log top tag of outgoing stanzas on c2s (#776)
author Kim Alvefur <zash@zash.se>
date Sun, 22 Jul 2018 19:41:29 +0200
parent 8872:4d7a822e837f
child 9065:f3adcc3fce8c
comparison
equal deleted inserted replaced
9061:82dd435c942c 9062:1b272b51ae0f
31 local function new_session(conn) 31 local function new_session(conn)
32 local session = { conn = conn, type = "c2s_unauthed", conntime = gettime() }; 32 local session = { conn = conn, type = "c2s_unauthed", conntime = gettime() };
33 local filter = initialize_filters(session); 33 local filter = initialize_filters(session);
34 local w = conn.write; 34 local w = conn.write;
35 session.send = function (t) 35 session.send = function (t)
36 session.log("debug", "sending: %s", t.top_tag and t:top_tag() or t:match("^[^>]*>?"));
36 if t.name then 37 if t.name then
37 t = filter("stanzas/out", t); 38 t = filter("stanzas/out", t);
38 end 39 end
39 if t then 40 if t then
40 t = filter("bytes/out", tostring(t)); 41 t = filter("bytes/out", tostring(t));