Skip to content

Commit

Permalink
best effort timestamp send
Browse files Browse the repository at this point in the history
  • Loading branch information
sterlingdeng committed Oct 22, 2024
1 parent 8bc98b1 commit bb8df6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions quinn-proto/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3304,6 +3304,11 @@ impl Connection {
buf,
);

if let Some(ts) = space.pending_acks.receiver_timestamps_as_mut() {
// Best effort / one try to send the timestamps to the peer.
ts.clear();
}

stats.frame_tx.acks += 1;
}

Expand Down
5 changes: 5 additions & 0 deletions quinn-proto/src/connection/receiver_timestamps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ impl ReceiverTimestamps {
});
}

pub(crate) fn clear(&mut self) {
self.data.clear();
}

#[allow(dead_code)]
pub(crate) fn subtract_below(&mut self, packet_number: u64) {
if self.data.is_empty() {
return;
Expand Down
4 changes: 0 additions & 4 deletions quinn-proto/src/connection/spaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,6 @@ impl PendingAcks {
/// Remove ACKs of packets numbered at or below `max` from the set of pending ACKs
pub(super) fn subtract_below(&mut self, max: u64) {
self.ranges.remove(0..(max + 1));

if let Some(v) = self.receiver_timestamps.as_mut() {
v.subtract_below(max);
}
}

/// Returns the set of currently pending ACK ranges
Expand Down

0 comments on commit bb8df6b

Please sign in to comment.