From d7af5d20678593261e15c2a31e651766510a651d Mon Sep 17 00:00:00 2001 From: Matthias Einwag Date: Tue, 22 Jun 2021 08:57:26 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Dirkjan Ochtman --- quinn-proto/src/connection/mod.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index d228b25ba7..2a1369c5eb 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -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 @@ -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();