tokio-xmpp: Add debug prints for incoming packets

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-05-29 17:56:57 +02:00
parent e8a7d909c1
commit 5256575512

View file

@ -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!("<< </stream:stream>");
return Ok(Some(Packet::StreamEnd));
}
}