Skip to content

Commit

Permalink
Update debug logs for recovery module
Browse files Browse the repository at this point in the history
  • Loading branch information
iyangsj committed Oct 17, 2024
1 parent 9cc6a62 commit 6ab1aa8
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/connection/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,23 @@ impl Recovery {

/// Check whether this path can still send packets.
pub(crate) fn can_send(&mut self) -> bool {
self.bytes_in_flight < self.congestion.congestion_window() as usize
&& (!self.pacer.enabled() || self.can_pacing())
if self.bytes_in_flight >= self.congestion.congestion_window() as usize {
debug!(
"{} sending is limited by congestion controller, inflight {}, window {}",
self.trace_id,
self.bytes_in_flight,
self.congestion.congestion_window()
);
return false;
}
if self.pacer.enabled() && !self.can_pacing() {
debug!(
"{} sending is limited by pacer, pacing timer {:?}",
self.trace_id, self.pacer_timer
);
return false;
}
true
}

fn can_pacing(&mut self) -> bool {
Expand All @@ -850,12 +865,7 @@ impl Recovery {
);
}

if self.pacer_timer.is_none() {
true
} else {
trace!("{} pacing timer is {:?}", self.trace_id, self.pacer_timer);
false
}
self.pacer_timer.is_none()
}

/// Update statistics for the packet sent event
Expand Down

0 comments on commit 6ab1aa8

Please sign in to comment.