From 6d8e815a5cc86730e6d23421b3e992b3a879c868 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 18 Sep 2024 19:03:27 +0300 Subject: [PATCH] More from #1998 --- neqo-transport/src/recovery/mod.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/neqo-transport/src/recovery/mod.rs b/neqo-transport/src/recovery/mod.rs index 27360cb04b..a5753e6c84 100644 --- a/neqo-transport/src/recovery/mod.rs +++ b/neqo-transport/src/recovery/mod.rs @@ -786,19 +786,15 @@ impl LossRecovery { // Calculate PTO time for the given space. fn pto_time(&self, rtt: &RttEstimate, pn_space: PacketNumberSpace) -> Option { - if self.confirmed_time.is_none() && pn_space == PacketNumberSpace::ApplicationData { - None - } else { - self.spaces - .get(pn_space) - .and_then(|space| space.pto_base_time().map(|t| t + self.pto_period(rtt))) - } + self.spaces + .get(pn_space) + .and_then(|space| space.pto_base_time().map(|t| t + self.pto_period(rtt))) } /// Find the earliest PTO time for all active packet number spaces. /// Ignore Application if either Initial or Handshake have an active PTO. fn earliest_pto(&self, rtt: &RttEstimate) -> Option { - if self.confirmed_time.is_some() { + if self.confirmed() { self.pto_time(rtt, PacketNumberSpace::ApplicationData) } else { self.pto_time(rtt, PacketNumberSpace::Initial) @@ -1518,9 +1514,9 @@ mod tests { ON_SENT_SIZE, )); - assert!(lr.pto_time(PacketNumberSpace::ApplicationData).is_none()); // FIXME + assert!(lr.pto_time(PacketNumberSpace::ApplicationData).is_some()); lr.discard(PacketNumberSpace::Initial, pn_time(1)); - assert!(lr.pto_time(PacketNumberSpace::ApplicationData).is_none()); // FIXME + assert!(lr.pto_time(PacketNumberSpace::ApplicationData).is_some()); // Expiring state after the PTO on the ApplicationData space has // expired should result in setting a PTO state.