diff options
| author | tv <tv@krebsco.de> | 2026-10-29 01:52:37 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-29 01:52:37 +0100 |
| commit | bc6fb7aa5281a50ff3b1ab8b1deae18e04449e31 (patch) | |
| tree | e380f52f5ce0f70a46f50006ba82004ec2b684fc /src/transport/paths.rs | |
| parent | 22b7deb7f6ae8d353af94ef1f02bcccf2779e1c2 (diff) | |
log messages in paths layer
Diffstat (limited to 'src/transport/paths.rs')
| -rw-r--r-- | src/transport/paths.rs | 17 |
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); |
