Skip to content

Commit 55845bd

Browse files
flubdjc
authored andcommitted
Prefer sending extra ping again
This reverts the change that tries to avoid sending a PING frame if there are user datagrams to send. The problem is that the user dataram might not fit in the probe that will be sent. It is possible to do this better, but the quick thing is to accept the extra ping frame, the space wasted because of this is rather minimal. And if a user was sending user datagrams at just the right MTU size it is unlikely they would fit in the next packet anyway since typically the probe packet will end up with a smaller size-limit compared to the MTU.
1 parent d8302df commit 55845bd

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

quinn-proto/src/connection/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,7 @@ impl Connection {
470470
for space in SpaceId::iter() {
471471
let request_immediate_ack =
472472
space == SpaceId::Data && self.peer_supports_ack_frequency();
473-
self.spaces[space].maybe_queue_probe(
474-
request_immediate_ack,
475-
&self.streams,
476-
&self.datagrams,
477-
);
473+
self.spaces[space].maybe_queue_probe(request_immediate_ack, &self.streams);
478474
}
479475

480476
// Check whether we need to send a close message

quinn-proto/src/connection/spaces.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rand::Rng;
99
use rustc_hash::FxHashSet;
1010
use tracing::trace;
1111

12-
use super::{assembler::Assembler, datagrams::DatagramState};
12+
use super::assembler::Assembler;
1313
use crate::{
1414
Dir, Duration, Instant, SocketAddr, StreamId, TransportError, VarInt, connection::StreamsState,
1515
crypto::Keys, frame, packet::SpaceId, range_set::ArrayRangeSet, shared::IssuedCid,
@@ -118,7 +118,6 @@ impl PacketSpace {
118118
&mut self,
119119
request_immediate_ack: bool,
120120
streams: &StreamsState,
121-
datagrams: &DatagramState,
122121
) {
123122
if self.loss_probes == 0 {
124123
return;
@@ -130,7 +129,7 @@ impl PacketSpace {
130129
self.immediate_ack_pending = true;
131130
}
132131

133-
if !self.pending.is_empty(streams) || !datagrams.outgoing.is_empty() {
132+
if !self.pending.is_empty(streams) {
134133
// There's real data to send here, no need to make something up
135134
return;
136135
}

0 commit comments

Comments
 (0)