1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-08 09:42:06 +03:00

Changed last packet sent times to bet per-packet-number-space andthe PTO timer calculation from them

Summary:
This diff:
1) introduces `EnumArray` - effectively an `std::array` indexed by an enum
2) changes loss times and `lastRetransmittablePacketSentTime` inside `LossState`  to be an `EnumArray` indexed by `PacketNumberSpace`
3) makes the method `isHandshakeDone()` available for both client and server handshakes.
4) uses all those inputs to determine PTO timers in `earliestTimeAndSpace()`

Reviewed By: yangchi

Differential Revision: D19650864

fbshipit-source-id: d72e4a0cf61d2dcb76f0a7f4037c36a7c8156942
This commit is contained in:
Andrejs Krasilnikovs
2020-02-10 12:24:42 -08:00
committed by Facebook Github Bot
parent 1cf32345ba
commit 8114c3e3d0
11 changed files with 148 additions and 73 deletions

View File

@@ -1022,9 +1022,9 @@ TEST_F(QuicTransportTest, ClonePathChallenge) {
// knock every handshake outstanding packets out
conn.outstandingHandshakePacketsCount = 0;
conn.outstandingPackets.clear();
conn.lossState.initialLossTime.clear();
conn.lossState.handshakeLossTime.clear();
conn.lossState.appDataLossTime.clear();
for (auto& t : conn.lossState.lossTimes) {
t.clear();
}
PathChallengeFrame pathChallenge(123);
conn.pendingEvents.pathChallenge = pathChallenge;
@@ -1057,9 +1057,9 @@ TEST_F(QuicTransportTest, OnlyClonePathValidationIfOutstanding) {
// knock every handshake outstanding packets out
conn.outstandingHandshakePacketsCount = 0;
conn.outstandingPackets.clear();
conn.lossState.initialLossTime.clear();
conn.lossState.handshakeLossTime.clear();
conn.lossState.appDataLossTime.clear();
for (auto& t : conn.lossState.lossTimes) {
t.clear();
}
PathChallengeFrame pathChallenge(123);
conn.pendingEvents.pathChallenge = pathChallenge;
@@ -1199,9 +1199,9 @@ TEST_F(QuicTransportTest, ClonePathResponse) {
// knock every handshake outstanding packets out
conn.outstandingHandshakePacketsCount = 0;
conn.outstandingPackets.clear();
conn.lossState.initialLossTime.clear();
conn.lossState.handshakeLossTime.clear();
conn.lossState.appDataLossTime.clear();
for (auto& t : conn.lossState.lossTimes) {
t.clear();
}
EXPECT_EQ(conn.pendingEvents.frames.size(), 0);
PathResponseFrame pathResponse(123);
@@ -1282,9 +1282,9 @@ TEST_F(QuicTransportTest, CloneNewConnectionIdFrame) {
// knock every handshake outstanding packets out
conn.outstandingHandshakePacketsCount = 0;
conn.outstandingPackets.clear();
conn.lossState.initialLossTime.clear();
conn.lossState.handshakeLossTime.clear();
conn.lossState.appDataLossTime.clear();
for (auto& t : conn.lossState.lossTimes) {
t.clear();
}
NewConnectionIdFrame newConnId(
1, 0, ConnectionId({2, 4, 2, 3}), StatelessResetToken());
@@ -1420,9 +1420,9 @@ TEST_F(QuicTransportTest, CloneRetireConnectionIdFrame) {
// knock every handshake outstanding packets out
conn.outstandingHandshakePacketsCount = 0;
conn.outstandingPackets.clear();
conn.lossState.initialLossTime.clear();
conn.lossState.handshakeLossTime.clear();
conn.lossState.appDataLossTime.clear();
for (auto& t : conn.lossState.lossTimes) {
t.clear();
}
RetireConnectionIdFrame retireConnId(1);
sendSimpleFrame(conn, retireConnId);