Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions quiche/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3400,7 +3400,7 @@ impl<F: BufFactory> Connection<F> {
crypto_open: open_prev,
pn_on_update: pn,
update_acked: false,
timer: now + (recv_path.recovery.pto() * 3),
timer: now + recv_path.recovery.pto_timeout(),
});

self.key_phase = !self.key_phase;
Expand Down Expand Up @@ -4936,8 +4936,8 @@ impl<F: BufFactory> Connection<F> {
};

if push_frame_to_pkt!(b, frames, frame, left) {
let pto = path.recovery.pto();
self.draining_timer = Some(now + (pto * 3));
self.draining_timer =
Some(now + path.recovery.pto_timeout());

ack_eliciting = true;
in_flight = true;
Expand All @@ -4952,8 +4952,8 @@ impl<F: BufFactory> Connection<F> {
};

if push_frame_to_pkt!(b, frames, frame, left) {
let pto = path.recovery.pto();
self.draining_timer = Some(now + (pto * 3));
self.draining_timer =
Some(now + path.recovery.pto_timeout());

ack_eliciting = true;
in_flight = true;
Expand Down Expand Up @@ -8684,7 +8684,7 @@ impl<F: BufFactory> Connection<F> {
});

let path = self.paths.get_active()?;
self.draining_timer = Some(now + (path.recovery.pto() * 3));
self.draining_timer = Some(now + path.recovery.pto_timeout());
},

frame::Frame::ApplicationClose { error_code, reason } => {
Expand All @@ -8695,7 +8695,7 @@ impl<F: BufFactory> Connection<F> {
});

let path = self.paths.get_active()?;
self.draining_timer = Some(now + (path.recovery.pto() * 3));
self.draining_timer = Some(now + path.recovery.pto_timeout());
},

frame::Frame::HandshakeDone => {
Expand Down
6 changes: 6 additions & 0 deletions quiche/src/recovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ pub trait RecoveryOps {

fn pto(&self) -> Duration;

/// Returns the PTO-based draining/closing timeout duration (3 * PTO),
/// as recommended in RFC 9000, Section 10.2.
fn pto_timeout(&self) -> Duration {
self.pto() * 3
}

/// The most recent data delivery rate estimate.
fn delivery_rate(&self) -> Bandwidth;

Expand Down