summaryrefslogtreecommitdiffstats
path: root/src/transport/paths.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/paths.rs')
-rw-r--r--src/transport/paths.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/transport/paths.rs b/src/transport/paths.rs
index 3baa092..1a01718 100644
--- a/src/transport/paths.rs
+++ b/src/transport/paths.rs
@@ -30,6 +30,11 @@
//! alive. The node's keepalive is a PING too (`swarm::peer::keepalive`), which paths
//! sends like any message, and notes as the probe of the path it went over.
//!
+//! Every message on every transport passes here, so this is where messages are logged
+//! (debug): `Sent message` once a transport took one, `Received message` as one
+//! arrives, each with its address and what it says. Failed sends are logged by those who
+//! sent them, with what they do about it.
+//!
//! The debug firewall (`transport::firewall`) works here, below everything else, through
//! a `Gate`: messages from an address it blocks are dropped as they arrive, and sends to
//! one are dropped silently, as by a lossy network.
@@ -665,7 +670,16 @@ impl Paths {
let mut inner = message.clone();
inner.peer = target.clone();
inner.address = target;
- link.inner.send_encoded(&inner).await
+ link.inner.send_encoded(&inner).await?;
+ match &message.message {
+ Some(parsed) => {
+ debug!(to = %message.address, bytes = message.payload_len, message = ?parsed, "Sent message");
+ }
+ None => {
+ debug!(to = %message.address, bytes = message.payload_len, kind = ?message.kind, "Sent message");
+ }
+ }
+ Ok(())
}
/// How the transport of `address` is connected there (`Transport::connection`).
@@ -762,6 +776,7 @@ impl Paths {
tracing::trace!(from = %address, "Firewall dropped inbound message");
return Ok(());
}
+ debug!(from = %address, bytes = payload_len, message = ?message, "Received message");
match message {
ParsedMessage::Ping(nonce) => {
let paths = Arc::clone(&self);