Require AppData packet number space when checking D6D packet
Summary: ^
MODIFY
quic/api/QuicTransportFunctions.cpp
quic/api/QuicTransportFunctions.cpp
@@ -480,11 +480,12 @@ void updateConnection(
bool retransmittable = false; // AckFrame and PaddingFrame are not retx-able.
bool isHandshake = false;
bool isPing = false;
- bool isD6DProbe =
- conn.d6d.lastProbe ? (packetNum == conn.d6d.lastProbe->packetNum) : false;
uint32_t connWindowUpdateSent = 0;
uint32_t ackFrameCounter = 0;
auto packetNumberSpace = packet.header.getPacketNumberSpace();
+ bool isD6DProbe = packetNumberSpace == PacketNumberSpace::AppData &&
+ conn.d6d.lastProbe.hasValue() &&
+ conn.d6d.lastProbe->packetNum == packetNum;
VLOG(10) << nodeToString(conn.nodeType) << " sent packetNum=" << packetNum
<< " in space=" << packetNumberSpace << " size=" << encodedSize
<< " " << conn;

MODIFY
quic/api/test/QuicTransportFunctionsTest.cpp
quic/api/test/QuicTransportFunctionsTest.cpp
@@ -374,6 +374,18 @@ TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionD6DNotConsumeSendPing) {
EXPECT_TRUE(conn->pendingEvents.sendPing);
}
+TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionD6DNeedsAppDataPNSpace) {
+ auto conn = createConn();
+ auto packet = buildEmptyPacket(*conn, PacketNumberSpace::Handshake);
+ packet.packet.frames.push_back(PingFrame());
+ auto packetNum = packet.packet.header.getPacketSequenceNum();
+ conn->d6d.lastProbe = D6DProbePacket(packetNum, 50);
+ updateConnection(*conn, folly::none, packet.packet, Clock::now(), 50);
+ EXPECT_EQ(1, conn->outstandings.packets.size());
+ EXPECT_FALSE(conn->outstandings.packets.front().metadata.isD6DProbe);
+ EXPECT_EQ(0, conn->d6d.outstandingProbes);
+}
+
TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionPacketSorting) {
auto conn = createConn();
conn->qLogger = std::make_shared<quic::FileQLogger>(VantagePoint::Client);

Require AppData packet number space when checking D6D packet

Summary: ^

Reviewed By: yangchi

Differential Revision: D25539225

fbshipit-source-id: 7d68917c73228c006ebec38be1ee86ccb12362f1