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

Make the AckState for Initial/Handshake a unique_ptr

Summary:
We don't need to carry these states after the handshake is confirmed, so make them pointers instead. This will facilitate adding a structure to the AckState for tracking duplicate packets.

(Note: this ignores all push blocking failures!)

Reviewed By: hanidamlaj

Differential Revision: D41626895

fbshipit-source-id: d8ac960b3672b9bb9adaaececa53a1203ec801e0
This commit is contained in:
Matt Joras
2022-12-20 11:08:43 -08:00
committed by Facebook GitHub Bot
parent 1a41bc78cf
commit 1275798146
20 changed files with 281 additions and 217 deletions

View File

@@ -1161,17 +1161,18 @@ TEST_F(QuicStateFunctionsTest, GetOutstandingPackets) {
TEST_F(QuicStateFunctionsTest, UpdateLargestReceivePacketsAtLatCloseSent) {
QuicConnectionStateBase conn(QuicNodeType::Client);
EXPECT_FALSE(conn.ackStates.initialAckState.largestReceivedAtLastCloseSent);
EXPECT_FALSE(conn.ackStates.handshakeAckState.largestReceivedAtLastCloseSent);
EXPECT_FALSE(conn.ackStates.initialAckState->largestReceivedAtLastCloseSent);
EXPECT_FALSE(
conn.ackStates.handshakeAckState->largestReceivedAtLastCloseSent);
EXPECT_FALSE(conn.ackStates.appDataAckState.largestReceivedAtLastCloseSent);
conn.ackStates.initialAckState.largestRecvdPacketNum = 123;
conn.ackStates.handshakeAckState.largestRecvdPacketNum = 654;
conn.ackStates.initialAckState->largestRecvdPacketNum = 123;
conn.ackStates.handshakeAckState->largestRecvdPacketNum = 654;
conn.ackStates.appDataAckState.largestRecvdPacketNum = 789;
updateLargestReceivedPacketsAtLastCloseSent(conn);
EXPECT_EQ(
123, *conn.ackStates.initialAckState.largestReceivedAtLastCloseSent);
123, *conn.ackStates.initialAckState->largestReceivedAtLastCloseSent);
EXPECT_EQ(
654, *conn.ackStates.handshakeAckState.largestReceivedAtLastCloseSent);
654, *conn.ackStates.handshakeAckState->largestReceivedAtLastCloseSent);
EXPECT_EQ(
789, *conn.ackStates.appDataAckState.largestReceivedAtLastCloseSent);
}