From 11a42b8ff24dac751c88acf1549d54ffcc2fdca4 Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Thu, 27 Feb 2025 15:59:57 +0100 Subject: [PATCH] Use a better default cid len if missing It probably is never missing, but still nice to write like this --- quinn-proto/src/connection/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index 226edc3d7..3a166edee 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -4024,7 +4024,7 @@ impl Connection { .rem_cids .get(&path) .map(|cids| cids.active().len()) - .unwrap_or_default() + .unwrap_or(20) // Max CID len in QUIC v1 + pn_len + self.tag_len_1rtt() } @@ -4037,7 +4037,7 @@ impl Connection { .values() .map(|cids| cids.active().len()) .max() - .unwrap_or_default(); + .unwrap_or(20); // Max CID len in QUIC v1 // 1 byte for flags 1 + cid_len + pn_len + self.tag_len_1rtt()