aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/paths.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-01 21:39:21 +0100
committertv <tv@krebsco.de>2026-11-01 21:39:21 +0100
commitabc3f66b13daeeb55204c5a5b47152b136ce684d (patch)
tree54e4d29390539d18fdcd52e51e3b3011e513ea22 /src/transport/paths.rs
parent98b49df1e7631f99b0ad780fb0f01924cebd0756 (diff)
ping & pong are tied by nonce only
Diffstat (limited to 'src/transport/paths.rs')
-rw-r--r--src/transport/paths.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/transport/paths.rs b/src/transport/paths.rs
index 1f88e0a..ba8581f 100644
--- a/src/transport/paths.rs
+++ b/src/transport/paths.rs
@@ -878,8 +878,8 @@ impl Paths {
stats
}
- /// Sends a PING (or with `pong`, a PONG) with `nonce` to `address`, counted
- /// (`traffic`).
+ /// Sends a PING (or with `pong`, a PONG) with `nonce` to `address`, counted and
+ /// logged (`traffic`).
async fn send_probe(&self, address: &str, pong: bool, nonce: u64) -> Result<()> {
let message = if pong {
ParsedMessage::Pong {
@@ -896,6 +896,12 @@ impl Paths {
Ok(()) => traffic.sent(address, encoded.kind, encoded.payload_len),
Err(_) => traffic.refused(address, encoded.kind, encoded.payload_len),
}
+ // Logged too, under the address: the PINGs and PONGs that come back go up to
+ // the node and are logged there, and an exchange is seen whole.
+ let way = if sent.is_ok() { "sent" } else { "refused" };
+ traffic
+ .log
+ .note(way, address, &message, encoded.payload_len);
}
sent
}