# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1635081061 -7200
# Node ID bb20cfd4884ffbe8e7f7e3c4efc7d6785276457d
# Parent  515a89dee6aee9b77303512f2416fcdc7f5840f4
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.

diff -r 515a89dee6ae -r bb20cfd4884f plugins/mod_s2s.lua
--- a/plugins/mod_s2s.lua	Sat Oct 23 22:24:59 2021 +0200
+++ b/plugins/mod_s2s.lua	Sun Oct 24 15:11:01 2021 +0200
@@ -650,7 +650,7 @@
 		if st.is_stanza(stream_error) then
 			-- to and from are never unknown on outgoing connections
 			log("debug", "Disconnecting %s->%s[%s], <stream:error> is: %s",
-				session.from_host or "(unknown host)" or session.ip, session.to_host or "(unknown host)", session.type, reason);
+				session.from_host or "(unknown host)" or session.ip, session.to_host or "(unknown host)", session.type, stream_error);
 			session.sends2s(stream_error);
 		end
 	else