Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
  • Loading branch information
Matthias247 and djc authored Jun 22, 2021
1 parent a49564a commit d7af5d2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions quinn-proto/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,11 @@ where

let sent = self.populate_packet(space_id, &mut buf, buf_capacity - builder.tag_len);

// ACK-only packets should only be sent when explicitely allowed
// If we write them due to another reason there is a bug somewhere
// which leads to one component announcing write readiness and not writing any data.
// This degrades performance.
// The condition is only checked if the full MTU is available, so that lack of
// space in the datagram isn't the reaason for just writing ACKs.
// ACK-only packets should only be sent when explicitly allowed. If we write them due
// to any other reason, there is a bug which leads to one component announcing write
// readiness while not writing any data. This degrades performance. The condition is
// only checked if the full MTU is available, so that lack of space in the datagram isn't
// the reason for just writing ACKs.
debug_assert!(
!(sent.is_ack_only()
&& !can_send.acks
Expand Down Expand Up @@ -773,7 +772,7 @@ where
})
}

/// Returns `if a space has outgoing data to send and what the expected type of data is
/// Indicate what types of frames are ready to send for the given space
fn space_can_send(&self, space_id: SpaceId) -> SendableFrames {
if self.spaces[space_id].crypto.is_some() {
let can_send = self.spaces[space_id].can_send();
Expand Down

0 comments on commit d7af5d2

Please sign in to comment.