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
10 changes: 6 additions & 4 deletions quiche/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,13 @@ impl Path {

/// Returns whether the path is unused.
#[inline]
fn unused(&self) -> bool {
// FIXME: we should check that there is nothing in the sent queue.
!self.active() && self.active_dcid_seq.is_none()
fn unused(&self) -> bool {
// FIXME: we should check that there is nothing in the sent queue.
!self.active() &&
self.active_dcid_seq.is_none() &&
self.recovery.bytes_in_flight_duration() == Duration::ZERO &&
self.recovery.sent_packets_empty()
}

/// Returns whether the path requires sending a probing packet.
#[inline]
pub fn probing_required(&self) -> bool {
Expand Down
6 changes: 5 additions & 1 deletion quiche/src/recovery/congestion/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,6 @@ impl RecoveryOps for LegacyRecovery {
}

self.epochs[epoch].sent_packets.push_back(pkt);

trace!("{trace_id} {self:?}");
}

Expand Down Expand Up @@ -1042,6 +1041,10 @@ impl RecoveryOps for LegacyRecovery {
fn bytes_lost(&self) -> u64 {
self.bytes_lost
}

fn sent_packets_empty(&self) -> bool {
self.epochs.iter().all(|epoch| epoch.sent_packets.is_empty())
}
}

impl std::fmt::Debug for LegacyRecovery {
Expand Down Expand Up @@ -1091,3 +1094,4 @@ pub struct Acked {

pub is_app_limited: bool,
}

3 changes: 3 additions & 0 deletions quiche/src/recovery/gcongestion/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,9 @@ impl RecoveryOps for GRecovery {
.min(64 * 1024)
.max(floor as u64) as usize
}
fn sent_packets_empty(&self) -> bool {
self.epochs.iter().all(|epoch| epoch.sent_packets.is_empty())
}
}

impl std::fmt::Debug for GRecovery {
Expand Down
4 changes: 3 additions & 1 deletion quiche/src/recovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub struct OnLossDetectionTimeoutOutcome {
pub trait RecoveryOps {
fn lost_count(&self) -> usize;
fn bytes_lost(&self) -> u64;

/// Returns whether or not we should elicit an ACK even if we wouldn't
/// otherwise have constructed an ACK eliciting packet.
fn should_elicit_ack(&self, epoch: packet::Epoch) -> bool;
Expand Down Expand Up @@ -315,6 +315,8 @@ pub trait RecoveryOps {
fn get_next_release_time(&self) -> ReleaseDecision;

fn gcongestion_enabled(&self) -> bool;

fn sent_packets_empty(&self) -> bool;
}

impl Recovery {
Expand Down