From 5256575512df55a96fdbdcfeb73d8042f92f8fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 29 May 2023 17:56:57 +0200 Subject: [PATCH] tokio-xmpp: Add debug prints for incoming packets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- tokio-xmpp/src/xmpp_codec.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tokio-xmpp/src/xmpp_codec.rs b/tokio-xmpp/src/xmpp_codec.rs index c3f2deae..77a8a123 100644 --- a/tokio-xmpp/src/xmpp_codec.rs +++ b/tokio-xmpp/src/xmpp_codec.rs @@ -88,16 +88,19 @@ impl Decoder for XMPPCodec { }, )) .collect(); + debug!("<< {}", String::from(root)); return Ok(Some(Packet::StreamStart(attrs))); } else if self.stanza_builder.depth() == 1 { self.driver.release_temporaries(); if let Some(stanza) = self.stanza_builder.unshift_child() { + debug!("<< {}", String::from(&stanza)); return Ok(Some(Packet::Stanza(stanza))); } } else if let Some(_) = self.stanza_builder.root.take() { self.driver.release_temporaries(); + debug!("<< "); return Ok(Some(Packet::StreamEnd)); } }