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

Refactor ACK writing for the different ACK types

Summary:
This replaces three separate functions for writing ACK, ACK_ECN, and ACK_RECEIVE_TIMESTAMPS with one function that can write all three.

Previously, we have two paths:
1. Default path which writes the base ACK frame and optionally adds the ECN counts if the frame type is ACK_ECN.
2. If ACK_RECEIVE_TIMESTAMPS are supported, another path would take the ART config and write that frame with the ART fields.
Path #2 does not support ECN marks.

This change consolidates ACK writing into a single path which takes ART config and frame type. It decides which fields to include based upon the type and config passed. This change does not add any new frame types but it prepares for one that can carry both ECN counts and ART fields.

Differential Revision: D68931147

fbshipit-source-id: 47b425b30f00b6c76574bc768d0ec249c60a0aa7
This commit is contained in:
Joseph Beshay
2025-02-13 17:48:18 -08:00
committed by Facebook GitHub Bot
parent 40146c4558
commit 015c62e964
5 changed files with 227 additions and 208 deletions

View File

@ -621,9 +621,10 @@ Optional<PacketNum> AckScheduler::writeNextAcks(
isAckReceiveTimestampsSupported && (peerRequestedTimestampsCount > 0)) {
// Use ACK_RECEIVE_TIMESTAMPS if its enabled on both endpoints AND the peer
// requests at least 1 timestamp
ackWriteResult = writeAckFrameWithReceivedTimestamps(
ackWriteResult = writeAckFrame(
meta,
builder,
FrameType::ACK_RECEIVE_TIMESTAMPS,
conn_.transportSettings.maybeAckReceiveTimestampsConfigSentToPeer
.value(),
peerRequestedTimestampsCount);