Comparison

plugins/mod_s2s.lua @ 11867:bb20cfd4884f

mod_s2s: Fix logging of <stream:error> consistency with other mods `reason` was often a table, so the log said "table: 0xptr" or such. mod_c2s, mod_bosh etc logs the stream error stanza object, so better do the same. It would be nicer if this was an util.error object, but that will have to be a future change.
author Kim Alvefur <zash@zash.se>
date Sun, 24 Oct 2021 15:11:01 +0200
parent 11859:14cf34d35c30
child 12206:77ac0d96ac24
comparison
equal deleted inserted replaced
11866:515a89dee6ae 11867:bb20cfd4884f
648 m_closed_connections:with_labels(this_host, session.direction, condition):add(1) 648 m_closed_connections:with_labels(this_host, session.direction, condition):add(1)
649 end 649 end
650 if st.is_stanza(stream_error) then 650 if st.is_stanza(stream_error) then
651 -- to and from are never unknown on outgoing connections 651 -- to and from are never unknown on outgoing connections
652 log("debug", "Disconnecting %s->%s[%s], <stream:error> is: %s", 652 log("debug", "Disconnecting %s->%s[%s], <stream:error> is: %s",
653 session.from_host or "(unknown host)" or session.ip, session.to_host or "(unknown host)", session.type, reason); 653 session.from_host or "(unknown host)" or session.ip, session.to_host or "(unknown host)", session.type, stream_error);
654 session.sends2s(stream_error); 654 session.sends2s(stream_error);
655 end 655 end
656 else 656 else
657 m_closed_connections:with_labels(this_host or ":unknown", session.direction, reason == false and ":remote-choice" or ":local-choice"):add(1) 657 m_closed_connections:with_labels(this_host or ":unknown", session.direction, reason == false and ":remote-choice" or ":local-choice"):add(1)
658 end 658 end