From 5e0d96b76793c5c5dec15e24976c44e70d34c0b8 Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Wed, 14 Aug 2024 13:19:22 -0500 Subject: [PATCH] exposes current path MTU discovered in connection stats --- quinn-proto/src/connection/mod.rs | 1 + quinn-proto/src/connection/stats.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index 4083c494e..2c0f92b55 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -1207,6 +1207,7 @@ impl Connection { let mut stats = self.stats; stats.path.rtt = self.path.rtt.get(); stats.path.cwnd = self.path.congestion.window(); + stats.path.current_mtu = self.path.mtud.current_mtu(); stats } diff --git a/quinn-proto/src/connection/stats.rs b/quinn-proto/src/connection/stats.rs index 0bb612e08..fc19c6304 100644 --- a/quinn-proto/src/connection/stats.rs +++ b/quinn-proto/src/connection/stats.rs @@ -152,6 +152,8 @@ pub struct PathStats { pub lost_plpmtud_probes: u64, /// The number of times a black hole was detected in the path pub black_holes_detected: u64, + /// Largest UDP payload size the path currently supports + pub current_mtu: u16, } /// Connection statistics