1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-07-30 14:43:05 +03:00

Immediately retransmit initial packets in writeCryptoAndAckDataToSocket

Summary: In `writeCryptoAndAckDataToSocket`, add an additional `writeProbingDataToSocket` call at the end that is limited to the number of CRYPTO frame-containing packets just written, gated by the new `TransportSetttings` field `immediatelyRetransmitInitialPackets`.

Reviewed By: mjoras

Differential Revision: D64485616

fbshipit-source-id: f0927a3796767700fd46673195e1cd4e1bbbcbeb
This commit is contained in:
Jolene Tan
2024-10-24 15:30:20 -07:00
committed by Facebook GitHub Bot
parent cc14fe8d55
commit 1dad9543b9
3 changed files with 55 additions and 1 deletions

View File

@ -1107,7 +1107,7 @@ WriteQuicDataResult writeCryptoAndAckDataToSocket(
connection,
srcConnId,
dstConnId,
std::move(builder),
builder,
LongHeader::typeToPacketNumberSpace(packetType),
scheduler,
congestionControlWritableBytes,
@ -1121,6 +1121,27 @@ WriteQuicDataResult writeCryptoAndAckDataToSocket(
packetsWritten += writeResult.packetsWritten;
bytesWritten += writeResult.bytesWritten;
if (connection.transportSettings.immediatelyRetransmitInitialPackets &&
packetsWritten > 0 && packetsWritten < packetLimit) {
auto remainingLimit = packetLimit - packetsWritten;
auto cloneResult = writeProbingDataToSocket(
sock,
connection,
srcConnId,
dstConnId,
builder,
encryptionLevel,
LongHeader::typeToPacketNumberSpace(packetType),
scheduler,
packetsWritten < remainingLimit ? packetsWritten : remainingLimit,
cleartextCipher,
headerCipher,
version,
token);
probesWritten += cloneResult.probesWritten;
bytesWritten += cloneResult.bytesWritten;
}
VLOG_IF(10, packetsWritten || probesWritten)
<< nodeToString(connection.nodeType)
<< " written crypto and acks data type=" << packetType