1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-07-29 03:41:11 +03:00

Only skip cloned CRYPTO packet if same as most recent outstanding packet

Summary:
In CloningScheduler, in the loop for selecting a candidate packet for cloning under the "cloneAllPacketsWithCryptoFrame" mode of operation, skip a packet containing a CRYPTO frame only if both it and the most recent outstanding packet are clones of the same packet.

Otherwise, it would clone the CRYPTO packets no more than once.

Reviewed By: mjoras

Differential Revision: D64411438

fbshipit-source-id: eac9e3dbb4c6d2536b1259af08f3c9647ef06ad8
This commit is contained in:
Jolene Tan
2024-10-15 18:04:35 -07:00
committed by Facebook GitHub Bot
parent 81c88967a0
commit 599d410b01
2 changed files with 72 additions and 32 deletions

View File

@ -920,14 +920,19 @@ SchedulingResult CloningScheduler::scheduleFramesForPacket(
}
// The packet is already a clone
if (outstandingPacket.maybeClonedPacketIdentifier) {
// If packet has CRYPTO frame, don't clone it again even if not processed
// yet, move on to give next packet a chance to be cloned
const auto& frames = outstandingPacket.packet.frames;
if (conn_.transportSettings.cloneAllPacketsWithCryptoFrame &&
std::find_if(frames.begin(), frames.end(), [](const auto& frame) {
return frame.type() == QuicWriteFrame::Type::WriteCryptoFrame;
}) != frames.end()) {
continue;
if (conn_.transportSettings.cloneAllPacketsWithCryptoFrame) {
// Has CRYPTO frame
if (std::find_if(frames.begin(), frames.end(), [](const auto& frame) {
return frame.type() == QuicWriteFrame::Type::WriteCryptoFrame;
}) != frames.end()) {
auto mostRecentOutstandingPacketIdentifier =
conn_.outstandings.packets.back().maybeClonedPacketIdentifier;
if (mostRecentOutstandingPacketIdentifier ==
outstandingPacket.maybeClonedPacketIdentifier) {
continue;
}
}
}
// Otherwise, clone until it is processed
if (conn_.outstandings.clonedPacketIdentifiers.count(