Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(s2n-quic-core): allow forced PTO transmissions #2130

Merged
merged 3 commits into from
Apr 18, 2024
Merged
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
13 changes: 12 additions & 1 deletion quic/s2n-quic-core/src/recovery/pto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ impl Pto {
pub fn transmissions(&self) -> u8 {
self.state.transmissions()
}

#[inline]
pub fn on_transmit_once(&mut self) {
self.state.on_transmit();
}

#[inline]
pub fn force_transmit(&mut self) {
ensure!(matches!(self.state, State::Idle));
self.state = State::RequiresTransmission(1);
}
}

impl timer::Provider for Pto {
Expand Down Expand Up @@ -120,7 +131,7 @@ impl transmission::Provider for Pto {
// The early transmission will automatically ensure all initial packets sent by the
// client are padded to 1200 bytes

self.state.on_transmit();
self.on_transmit_once();
}
}

Expand Down
Loading