Skip to content

Commit

Permalink
feat(s2n-quic-core): allow forced PTO transmissions (#2130)
Browse files Browse the repository at this point in the history
* feat(s2n-quic-core): allow forced PTO transmissions

* rename to on_transmit_once and use in on_transmit

---------

Co-authored-by: Wesley Rosenblum <[email protected]>
  • Loading branch information
camshaft and WesleyRosenblum authored Apr 18, 2024
1 parent bfb921d commit e0f224b
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit e0f224b

Please sign in to comment.