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

Make OutstandingPacketMetadata::DetailsPerStream non-optional

Summary: As titled. Reduces confusion, as we always expect this to be populated.

Differential Revision: D31887097

fbshipit-source-id: 153b05bae8abd559fe49d2c07c64d2ad0d92a809
This commit is contained in:
Brandon Schlinker
2021-12-11 22:39:07 -08:00
committed by Facebook GitHub Bot
parent 7233c55d29
commit 82fd138b5e
12 changed files with 219 additions and 98 deletions

View File

@ -82,7 +82,18 @@ PacketNum addInitialOutstandingPacket(QuicConnectionStateBase& conn) {
QuicVersion::QUIC_DRAFT); QuicVersion::QUIC_DRAFT);
RegularQuicWritePacket packet(std::move(header)); RegularQuicWritePacket packet(std::move(header));
conn.outstandings.packets.emplace_back( conn.outstandings.packets.emplace_back(
packet, Clock::now(), 0, 0, true, 0, 0, 0, 0, LossState(), 0); packet,
Clock::now(),
0,
0,
true,
0,
0,
0,
0,
LossState(),
0,
OutstandingPacketMetadata::DetailsPerStream());
conn.outstandings.packetCount[PacketNumberSpace::Initial]++; conn.outstandings.packetCount[PacketNumberSpace::Initial]++;
increaseNextPacketNum(conn, PacketNumberSpace::Initial); increaseNextPacketNum(conn, PacketNumberSpace::Initial);
return nextPacketNum; return nextPacketNum;
@ -101,7 +112,18 @@ PacketNum addHandshakeOutstandingPacket(QuicConnectionStateBase& conn) {
QuicVersion::QUIC_DRAFT); QuicVersion::QUIC_DRAFT);
RegularQuicWritePacket packet(std::move(header)); RegularQuicWritePacket packet(std::move(header));
conn.outstandings.packets.emplace_back( conn.outstandings.packets.emplace_back(
packet, Clock::now(), 0, 0, true, 0, 0, 0, 0, LossState(), 0); packet,
Clock::now(),
0,
0,
true,
0,
0,
0,
0,
LossState(),
0,
OutstandingPacketMetadata::DetailsPerStream());
conn.outstandings.packetCount[PacketNumberSpace::Handshake]++; conn.outstandings.packetCount[PacketNumberSpace::Handshake]++;
increaseNextPacketNum(conn, PacketNumberSpace::Handshake); increaseNextPacketNum(conn, PacketNumberSpace::Handshake);
return nextPacketNum; return nextPacketNum;
@ -115,7 +137,18 @@ PacketNum addOutstandingPacket(QuicConnectionStateBase& conn) {
nextPacketNum); nextPacketNum);
RegularQuicWritePacket packet(std::move(header)); RegularQuicWritePacket packet(std::move(header));
conn.outstandings.packets.emplace_back( conn.outstandings.packets.emplace_back(
packet, Clock::now(), 0, 0, false, 0, 0, 0, 0, LossState(), 0); packet,
Clock::now(),
0,
0,
false,
0,
0,
0,
0,
LossState(),
0,
OutstandingPacketMetadata::DetailsPerStream());
increaseNextPacketNum(conn, PacketNumberSpace::AppData); increaseNextPacketNum(conn, PacketNumberSpace::AppData);
return nextPacketNum; return nextPacketNum;
} }

View File

@ -1681,11 +1681,10 @@ TEST_F(QuicTransportFunctionsTest, TestStreamDetailsControlPacket) {
// If we have only control frames sent, there should be no stream data in the // If we have only control frames sent, there should be no stream data in the
// outstanding packet. // outstanding packet.
ASSERT_EQ(1, conn->outstandings.packets.size()); ASSERT_EQ(1, conn->outstandings.packets.size());
auto detailsPerStream = const auto& detailsPerStream =
getFirstOutstandingPacket(*conn, PacketNumberSpace::AppData) getFirstOutstandingPacket(*conn, PacketNumberSpace::AppData)
->metadata.maybeDetailsPerStream; ->metadata.detailsPerStream.getDetails();
EXPECT_EQ(true, detailsPerStream.has_value()); EXPECT_EQ(0, detailsPerStream.size());
EXPECT_EQ(0, detailsPerStream->getDetails().size());
} }
TEST_F(QuicTransportFunctionsTest, TestStreamDetailsAppDataPacketSingleStream) { TEST_F(QuicTransportFunctionsTest, TestStreamDetailsAppDataPacketSingleStream) {
@ -1708,7 +1707,7 @@ TEST_F(QuicTransportFunctionsTest, TestStreamDetailsAppDataPacketSingleStream) {
ASSERT_EQ(1, conn->outstandings.packets.size()); ASSERT_EQ(1, conn->outstandings.packets.size());
auto detailsPerStream = auto detailsPerStream =
getFirstOutstandingPacket(*conn, PacketNumberSpace::AppData) getFirstOutstandingPacket(*conn, PacketNumberSpace::AppData)
->metadata.maybeDetailsPerStream->getDetails(); ->metadata.detailsPerStream.getDetails();
EXPECT_EQ(1, detailsPerStream.size()); EXPECT_EQ(1, detailsPerStream.size());
auto streamDetail = detailsPerStream[stream->id]; auto streamDetail = detailsPerStream[stream->id];
EXPECT_EQ(false, streamDetail.finObserved); EXPECT_EQ(false, streamDetail.finObserved);
@ -1743,7 +1742,7 @@ TEST_F(
ASSERT_EQ(1, conn->outstandings.packets.size()); ASSERT_EQ(1, conn->outstandings.packets.size());
auto detailsPerStream = auto detailsPerStream =
getFirstOutstandingPacket(*conn, PacketNumberSpace::AppData) getFirstOutstandingPacket(*conn, PacketNumberSpace::AppData)
->metadata.maybeDetailsPerStream->getDetails(); ->metadata.detailsPerStream.getDetails();
EXPECT_EQ(1, detailsPerStream.size()); EXPECT_EQ(1, detailsPerStream.size());
auto streamDetail = detailsPerStream[stream->id]; auto streamDetail = detailsPerStream[stream->id];
EXPECT_EQ(true, streamDetail.finObserved); EXPECT_EQ(true, streamDetail.finObserved);
@ -1778,7 +1777,7 @@ TEST_F(
// The first outstanding packet is the one with new data // The first outstanding packet is the one with new data
auto detailsPerStream = auto detailsPerStream =
getFirstOutstandingPacket(*conn, PacketNumberSpace::AppData) getFirstOutstandingPacket(*conn, PacketNumberSpace::AppData)
->metadata.maybeDetailsPerStream->getDetails(); ->metadata.detailsPerStream.getDetails();
EXPECT_EQ(1, detailsPerStream.size()); EXPECT_EQ(1, detailsPerStream.size());
auto streamDetail = detailsPerStream[stream->id]; auto streamDetail = detailsPerStream[stream->id];
EXPECT_EQ(false, streamDetail.finObserved); EXPECT_EQ(false, streamDetail.finObserved);
@ -1802,7 +1801,7 @@ TEST_F(
// The second outstanding packet is the one with retransmit data // The second outstanding packet is the one with retransmit data
detailsPerStream = getLastOutstandingPacket(*conn, PacketNumberSpace::AppData) detailsPerStream = getLastOutstandingPacket(*conn, PacketNumberSpace::AppData)
->metadata.maybeDetailsPerStream->getDetails(); ->metadata.detailsPerStream.getDetails();
EXPECT_EQ(1, detailsPerStream.size()); EXPECT_EQ(1, detailsPerStream.size());
streamDetail = detailsPerStream[stream->id]; streamDetail = detailsPerStream[stream->id];
EXPECT_EQ(false, streamDetail.finObserved); EXPECT_EQ(false, streamDetail.finObserved);
@ -1832,7 +1831,7 @@ TEST_F(
// The third outstanding packet will have both new and retransmitted data. // The third outstanding packet will have both new and retransmitted data.
detailsPerStream = getLastOutstandingPacket(*conn, PacketNumberSpace::AppData) detailsPerStream = getLastOutstandingPacket(*conn, PacketNumberSpace::AppData)
->metadata.maybeDetailsPerStream->getDetails(); ->metadata.detailsPerStream.getDetails();
EXPECT_EQ(1, detailsPerStream.size()); EXPECT_EQ(1, detailsPerStream.size());
streamDetail = detailsPerStream[stream->id]; streamDetail = detailsPerStream[stream->id];
EXPECT_EQ(false, streamDetail.finObserved); EXPECT_EQ(false, streamDetail.finObserved);
@ -1857,7 +1856,7 @@ TEST_F(
// The forth outstanding packet will have only retransmit data. // The forth outstanding packet will have only retransmit data.
detailsPerStream = getLastOutstandingPacket(*conn, PacketNumberSpace::AppData) detailsPerStream = getLastOutstandingPacket(*conn, PacketNumberSpace::AppData)
->metadata.maybeDetailsPerStream->getDetails(); ->metadata.detailsPerStream.getDetails();
EXPECT_EQ(1, detailsPerStream.size()); EXPECT_EQ(1, detailsPerStream.size());
streamDetail = detailsPerStream[stream->id]; streamDetail = detailsPerStream[stream->id];
EXPECT_EQ(false, streamDetail.finObserved); EXPECT_EQ(false, streamDetail.finObserved);
@ -1901,7 +1900,7 @@ TEST_F(
ASSERT_EQ(1, conn->outstandings.packets.size()); ASSERT_EQ(1, conn->outstandings.packets.size());
auto detailsPerStream = auto detailsPerStream =
getFirstOutstandingPacket(*conn, PacketNumberSpace::AppData) getFirstOutstandingPacket(*conn, PacketNumberSpace::AppData)
->metadata.maybeDetailsPerStream->getDetails(); ->metadata.detailsPerStream.getDetails();
EXPECT_EQ(2, detailsPerStream.size()); EXPECT_EQ(2, detailsPerStream.size());
auto stream1Detail = detailsPerStream[stream1Id]; auto stream1Detail = detailsPerStream[stream1Id];
auto stream2Detail = detailsPerStream[stream2Id]; auto stream2Detail = detailsPerStream[stream2Id];

View File

@ -39,7 +39,8 @@ OutstandingPacket makeDummyOutstandingPacket(
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
return packet; return packet;
} }

View File

@ -547,7 +547,8 @@ OutstandingPacket makeTestingWritePacket(
inflightBytes, inflightBytes,
0, 0,
LossState(), LossState(),
writeCount); writeCount,
OutstandingPacketMetadata::DetailsPerStream());
} }
CongestionController::AckEvent makeAck( CongestionController::AckEvent makeAck(
@ -576,8 +577,7 @@ CongestionController::AckEvent makeAck(
0 /* numOutstanding */, 0 /* numOutstanding */,
LossState() /* lossState */, LossState() /* lossState */,
0 /* writeCount */, 0 /* writeCount */,
folly::none /* detailsPerStream) */ OutstandingPacketMetadata::DetailsPerStream()))
))
.build()); .build());
ack.largestAckedPacketSentTime = sentTime; ack.largestAckedPacketSentTime = sentTime;
return ack; return ack;

View File

@ -41,7 +41,8 @@ class CopaTest : public Test {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream()));
loss.lostBytes = packetData.second; loss.lostBytes = packetData.second;
} }
loss.lostPackets = lostPackets.size(); loss.lostPackets = lostPackets.size();
@ -67,7 +68,8 @@ class CopaTest : public Test {
inflight, inflight,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
} }
CongestionController::AckEvent createAckEvent( CongestionController::AckEvent createAckEvent(

View File

@ -37,7 +37,8 @@ CongestionController::LossEvent createLossEvent(
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream()));
loss.lostBytes = packetData.second; loss.lostBytes = packetData.second;
} }
loss.lostPackets = lostPackets.size(); loss.lostPackets = lostPackets.size();
@ -66,7 +67,8 @@ CongestionController::AckEvent createAckEvent(
0, 0,
0, 0,
LossState(), LossState(),
0))); 0,
OutstandingPacketMetadata::DetailsPerStream())));
return ack; return ack;
} }
@ -89,7 +91,8 @@ OutstandingPacket createPacket(
inflight, inflight,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
} }
TEST_F(NewRenoTest, TestLoss) { TEST_F(NewRenoTest, TestLoss) {

View File

@ -212,7 +212,8 @@ TEST_F(QuicD6DStateFunctionsTest, D6DProbeAckedInBase) {
d6d.currentProbeSize, d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.lastProbe = D6DProbePacket( d6d.lastProbe = D6DProbePacket(
pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize); pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize);
d6d.raiser = std::make_unique<MockProbeSizeRaiser>(); d6d.raiser = std::make_unique<MockProbeSizeRaiser>();
@ -260,7 +261,8 @@ TEST_F(QuicD6DStateFunctionsTest, D6DProbeAckedInSearchingOne) {
d6d.currentProbeSize, d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.lastProbe = D6DProbePacket( d6d.lastProbe = D6DProbePacket(
pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize); pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize);
d6d.raiser = std::make_unique<MockProbeSizeRaiser>(); d6d.raiser = std::make_unique<MockProbeSizeRaiser>();
@ -309,7 +311,8 @@ TEST_F(QuicD6DStateFunctionsTest, D6DProbeAckedInSearchingMax) {
d6d.currentProbeSize, d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.lastProbe = D6DProbePacket( d6d.lastProbe = D6DProbePacket(
pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize); pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize);
d6d.raiser = std::make_unique<MockProbeSizeRaiser>(); d6d.raiser = std::make_unique<MockProbeSizeRaiser>();
@ -366,7 +369,8 @@ TEST_F(QuicD6DStateFunctionsTest, D6DProbeAckedInError) {
d6d.currentProbeSize, d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.lastProbe = D6DProbePacket( d6d.lastProbe = D6DProbePacket(
pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize); pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize);
d6d.raiser = std::make_unique<MockProbeSizeRaiser>(); d6d.raiser = std::make_unique<MockProbeSizeRaiser>();
@ -413,7 +417,8 @@ TEST_F(QuicD6DStateFunctionsTest, BlackholeInSearching) {
d6d.currentProbeSize, d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.lastProbe = D6DProbePacket( d6d.lastProbe = D6DProbePacket(
pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize); pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize);
@ -428,7 +433,8 @@ TEST_F(QuicD6DStateFunctionsTest, BlackholeInSearching) {
conn.udpSendPacketLen + d6d.currentProbeSize, conn.udpSendPacketLen + d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.thresholdCounter = std::make_unique<WindowedCounter<uint64_t, uint64_t>>( d6d.thresholdCounter = std::make_unique<WindowedCounter<uint64_t, uint64_t>>(
std::chrono::microseconds(kDefaultD6DBlackholeDetectionWindow).count(), std::chrono::microseconds(kDefaultD6DBlackholeDetectionWindow).count(),
@ -487,7 +493,9 @@ TEST_F(QuicD6DStateFunctionsTest, BlackholeInSearchComplete) {
d6d.currentProbeSize, d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.lastProbe = D6DProbePacket( d6d.lastProbe = D6DProbePacket(
pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize); pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize);
@ -502,7 +510,8 @@ TEST_F(QuicD6DStateFunctionsTest, BlackholeInSearchComplete) {
conn.udpSendPacketLen + d6d.currentProbeSize, conn.udpSendPacketLen + d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.thresholdCounter = std::make_unique<WindowedCounter<uint64_t, uint64_t>>( d6d.thresholdCounter = std::make_unique<WindowedCounter<uint64_t, uint64_t>>(
std::chrono::microseconds(kDefaultD6DBlackholeDetectionWindow).count(), std::chrono::microseconds(kDefaultD6DBlackholeDetectionWindow).count(),
@ -564,7 +573,8 @@ TEST_F(QuicD6DStateFunctionsTest, ReachMaxPMTU) {
d6d.currentProbeSize, d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.lastProbe = D6DProbePacket( d6d.lastProbe = D6DProbePacket(
pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize); pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize);
d6d.raiser = std::make_unique<MockProbeSizeRaiser>(); d6d.raiser = std::make_unique<MockProbeSizeRaiser>();
@ -605,7 +615,8 @@ TEST_F(
d6d.currentProbeSize, d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.lastProbe = D6DProbePacket( d6d.lastProbe = D6DProbePacket(
pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize); pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize);
d6d.raiser = std::make_unique<MockProbeSizeRaiser>(); d6d.raiser = std::make_unique<MockProbeSizeRaiser>();
@ -628,7 +639,8 @@ TEST_F(
d6d.currentProbeSize, d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
// Generate a false positive blackhole signal // Generate a false positive blackhole signal
detectPMTUBlackhole(conn, lostPacket); detectPMTUBlackhole(conn, lostPacket);
EXPECT_EQ(d6d.state, D6DMachineState::BASE); EXPECT_EQ(d6d.state, D6DMachineState::BASE);
@ -668,7 +680,8 @@ TEST_F(QuicD6DStateFunctionsTest, UpperboundIsBase) {
d6d.currentProbeSize, d6d.currentProbeSize,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
d6d.lastProbe = D6DProbePacket( d6d.lastProbe = D6DProbePacket(
pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize); pkt.packet.header.getPacketSequenceNum(), pkt.metadata.encodedSize);
d6d.raiser = std::make_unique<MockProbeSizeRaiser>(); d6d.raiser = std::make_unique<MockProbeSizeRaiser>();

View File

@ -256,7 +256,8 @@ PacketNum QuicLossFunctionsTest::sendPacket(
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
outstandingPacket.associatedEvent = associatedEvent; outstandingPacket.associatedEvent = associatedEvent;
conn.lossState.lastRetransmittablePacketSentTime = time; conn.lossState.lastRetransmittablePacketSentTime = time;
if (conn.congestionController) { if (conn.congestionController) {
@ -1007,8 +1008,19 @@ TEST_F(QuicLossFunctionsTest, TestHandleAckForLoss) {
conn->version.value()); conn->version.value());
RegularQuicWritePacket outstandingRegularPacket(std::move(longHeader)); RegularQuicWritePacket outstandingRegularPacket(std::move(longHeader));
auto now = Clock::now(); auto now = Clock::now();
conn->outstandings.packets.emplace_back(OutstandingPacket( conn->outstandings.packets.emplace_back(
outstandingRegularPacket, now, 0, 0, false, 0, 0, 0, 0, LossState(), 0)); outstandingRegularPacket,
now,
0,
0,
false,
0,
0,
0,
0,
LossState(),
0,
OutstandingPacketMetadata::DetailsPerStream());
conn->outstandings.packetCount[PacketNumberSpace::Handshake]++; conn->outstandings.packetCount[PacketNumberSpace::Handshake]++;
bool testLossMarkFuncCalled = false; bool testLossMarkFuncCalled = false;
@ -1889,8 +1901,7 @@ TEST_F(QuicLossFunctionsTest, PersistentCongestionAckOutsideWindow) {
0 /* numOutstanding */, 0 /* numOutstanding */,
LossState() /* lossState */, LossState() /* lossState */,
0 /* writeCount */, 0 /* writeCount */,
folly::none /* detailsPerStream) */ OutstandingPacketMetadata::DetailsPerStream()))
))
.build()); .build());
EXPECT_TRUE(isPersistentCongestion( EXPECT_TRUE(isPersistentCongestion(
@ -1917,8 +1928,7 @@ TEST_F(QuicLossFunctionsTest, PersistentCongestionAckInsideWindow) {
0 /* numOutstanding */, 0 /* numOutstanding */,
LossState() /* lossState */, LossState() /* lossState */,
0 /* writeCount */, 0 /* writeCount */,
folly::none /* detailsPerStream) */ OutstandingPacketMetadata::DetailsPerStream()))
))
.build()); .build());
EXPECT_FALSE(isPersistentCongestion( EXPECT_FALSE(isPersistentCongestion(
@ -1944,8 +1954,7 @@ TEST_F(QuicLossFunctionsTest, PersistentCongestionNoPTO) {
0 /* numOutstanding */, 0 /* numOutstanding */,
LossState() /* lossState */, LossState() /* lossState */,
0 /* writeCount */, 0 /* writeCount */,
folly::none /* detailsPerStream) */ OutstandingPacketMetadata::DetailsPerStream()))
))
.build()); .build());
EXPECT_FALSE(isPersistentCongestion( EXPECT_FALSE(isPersistentCongestion(

View File

@ -96,8 +96,8 @@ struct OutstandingPacketMetadata {
folly::F14FastMap<StreamId, StreamDetails> detailsPerStream; folly::F14FastMap<StreamId, StreamDetails> detailsPerStream;
}; };
// When enabled, details about each stream with frames in this packet // Details about each stream with frames in this packet
folly::Optional<DetailsPerStream> maybeDetailsPerStream; DetailsPerStream detailsPerStream;
OutstandingPacketMetadata( OutstandingPacketMetadata(
TimePoint timeIn, TimePoint timeIn,
@ -111,7 +111,7 @@ struct OutstandingPacketMetadata {
uint64_t packetsInflightIn, uint64_t packetsInflightIn,
const LossState& lossStateIn, const LossState& lossStateIn,
uint64_t writeCount, uint64_t writeCount,
folly::Optional<DetailsPerStream> maybeDetailsPerStream) DetailsPerStream detailsPerStream)
: time(timeIn), : time(timeIn),
encodedSize(encodedSizeIn), encodedSize(encodedSizeIn),
encodedBodySize(encodedBodySizeIn), encodedBodySize(encodedBodySizeIn),
@ -124,7 +124,7 @@ struct OutstandingPacketMetadata {
totalPacketsSent(lossStateIn.totalPacketsSent), totalPacketsSent(lossStateIn.totalPacketsSent),
totalAckElicitingPacketsSent(lossStateIn.totalAckElicitingPacketsSent), totalAckElicitingPacketsSent(lossStateIn.totalAckElicitingPacketsSent),
writeCount(writeCount), writeCount(writeCount),
maybeDetailsPerStream(std::move(maybeDetailsPerStream)) {} detailsPerStream(std::move(detailsPerStream)) {}
}; };
// Data structure to represent outstanding retransmittable packets // Data structure to represent outstanding retransmittable packets
@ -198,8 +198,7 @@ struct OutstandingPacket {
uint64_t packetsInflightIn, uint64_t packetsInflightIn,
const LossState& lossStateIn, const LossState& lossStateIn,
uint64_t writeCount, uint64_t writeCount,
folly::Optional<Metadata::DetailsPerStream> maybeDetailsPerStream = Metadata::DetailsPerStream detailsPerStream)
folly::none)
: packet(std::move(packetIn)), : packet(std::move(packetIn)),
metadata(OutstandingPacketMetadata( metadata(OutstandingPacketMetadata(
timeIn, timeIn,
@ -213,7 +212,7 @@ struct OutstandingPacket {
packetsInflightIn, packetsInflightIn,
lossStateIn, lossStateIn,
writeCount, writeCount,
std::move(maybeDetailsPerStream))) {} std::move(detailsPerStream))) {}
OutstandingPacket( OutstandingPacket(
RegularQuicWritePacket packetIn, RegularQuicWritePacket packetIn,
@ -228,8 +227,7 @@ struct OutstandingPacket {
uint64_t packetsInflightIn, uint64_t packetsInflightIn,
const LossState& lossStateIn, const LossState& lossStateIn,
uint64_t writeCount, uint64_t writeCount,
folly::Optional<Metadata::DetailsPerStream> maybeDetailsPerStream = Metadata::DetailsPerStream detailsPerStream)
folly::none)
: packet(std::move(packetIn)), : packet(std::move(packetIn)),
metadata(OutstandingPacketMetadata( metadata(OutstandingPacketMetadata(
timeIn, timeIn,
@ -243,6 +241,6 @@ struct OutstandingPacket {
packetsInflightIn, packetsInflightIn,
lossStateIn, lossStateIn,
writeCount, writeCount,
std::move(maybeDetailsPerStream))) {} std::move(detailsPerStream))) {}
}; };
} // namespace quic } // namespace quic

View File

@ -65,7 +65,8 @@ auto emplacePackets(
packetNum + 1, packetNum + 1,
packetNum + 1, packetNum + 1,
quic::LossState(), quic::LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
conn.outstandings.packets.emplace_back(sentPacket); conn.outstandings.packets.emplace_back(sentPacket);
packetNum++; packetNum++;
} }
@ -90,7 +91,7 @@ TEST_P(AckHandlersTest, TestAckMultipleSequentialBlocks) {
regularPacket.frames.emplace_back(std::move(frame)); regularPacket.frames.emplace_back(std::move(frame));
conn.outstandings conn.outstandings
.packetCount[regularPacket.header.getPacketNumberSpace()]++; .packetCount[regularPacket.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(regularPacket), std::move(regularPacket),
sentTime, sentTime,
1, 1,
@ -101,7 +102,8 @@ TEST_P(AckHandlersTest, TestAckMultipleSequentialBlocks) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
} }
ReadAckFrame ackFrame; ReadAckFrame ackFrame;
ackFrame.largestAcked = 101; ackFrame.largestAcked = 101;
@ -173,7 +175,7 @@ TEST_P(AckHandlersTest, TestAckMultipleSequentialBlocksLoss) {
regularPacket.frames.emplace_back(std::move(frame)); regularPacket.frames.emplace_back(std::move(frame));
conn.outstandings conn.outstandings
.packetCount[regularPacket.header.getPacketNumberSpace()]++; .packetCount[regularPacket.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(regularPacket), std::move(regularPacket),
sentTime, sentTime,
1, 1,
@ -184,7 +186,8 @@ TEST_P(AckHandlersTest, TestAckMultipleSequentialBlocksLoss) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
} }
ReadAckFrame ackFrame; ReadAckFrame ackFrame;
ackFrame.largestAcked = 101; ackFrame.largestAcked = 101;
@ -320,7 +323,7 @@ TEST_P(AckHandlersTest, TestAckBlocksWithGaps) {
regularPacket.frames.emplace_back(std::move(frame)); regularPacket.frames.emplace_back(std::move(frame));
conn.outstandings conn.outstandings
.packetCount[regularPacket.header.getPacketNumberSpace()]++; .packetCount[regularPacket.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(regularPacket), std::move(regularPacket),
Clock::now(), Clock::now(),
1, 1,
@ -331,7 +334,8 @@ TEST_P(AckHandlersTest, TestAckBlocksWithGaps) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
} }
ReadAckFrame ackFrame; ReadAckFrame ackFrame;
@ -430,7 +434,7 @@ TEST_P(AckHandlersTest, TestNonSequentialPacketNumbers) {
regularPacket.frames.emplace_back(std::move(frame)); regularPacket.frames.emplace_back(std::move(frame));
conn.outstandings conn.outstandings
.packetCount[regularPacket.header.getPacketNumberSpace()]++; .packetCount[regularPacket.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(regularPacket), std::move(regularPacket),
Clock::now(), Clock::now(),
1, 1,
@ -441,7 +445,8 @@ TEST_P(AckHandlersTest, TestNonSequentialPacketNumbers) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
} }
for (PacketNum packetNum = 20; packetNum < 40; packetNum += 3) { for (PacketNum packetNum = 20; packetNum < 40; packetNum += 3) {
@ -451,7 +456,7 @@ TEST_P(AckHandlersTest, TestNonSequentialPacketNumbers) {
regularPacket.frames.emplace_back(std::move(frame)); regularPacket.frames.emplace_back(std::move(frame));
conn.outstandings conn.outstandings
.packetCount[regularPacket.header.getPacketNumberSpace()]++; .packetCount[regularPacket.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(regularPacket), std::move(regularPacket),
Clock::now(), Clock::now(),
1, 1,
@ -462,7 +467,8 @@ TEST_P(AckHandlersTest, TestNonSequentialPacketNumbers) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
} }
ReadAckFrame ackFrame; ReadAckFrame ackFrame;
@ -543,7 +549,7 @@ TEST_P(AckHandlersTest, AckVisitorForAckTest) {
conn.ackStates.appDataAckState.acks.insert(500, 700); conn.ackStates.appDataAckState.acks.insert(500, 700);
firstPacket.frames.emplace_back(std::move(firstAckFrame)); firstPacket.frames.emplace_back(std::move(firstAckFrame));
conn.outstandings.packetCount[firstPacket.header.getPacketNumberSpace()]++; conn.outstandings.packetCount[firstPacket.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(firstPacket), std::move(firstPacket),
Clock::now(), Clock::now(),
0, 0,
@ -554,7 +560,8 @@ TEST_P(AckHandlersTest, AckVisitorForAckTest) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
auto secondPacket = createNewPacket(101 /* packetNum */, GetParam()); auto secondPacket = createNewPacket(101 /* packetNum */, GetParam());
WriteAckFrame secondAckFrame; WriteAckFrame secondAckFrame;
@ -564,7 +571,7 @@ TEST_P(AckHandlersTest, AckVisitorForAckTest) {
conn.ackStates.appDataAckState.acks.insert(1002, 1090); conn.ackStates.appDataAckState.acks.insert(1002, 1090);
secondPacket.frames.emplace_back(std::move(secondAckFrame)); secondPacket.frames.emplace_back(std::move(secondAckFrame));
conn.outstandings.packetCount[secondPacket.header.getPacketNumberSpace()]++; conn.outstandings.packetCount[secondPacket.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(secondPacket), std::move(secondPacket),
Clock::now(), Clock::now(),
0, 0,
@ -575,7 +582,8 @@ TEST_P(AckHandlersTest, AckVisitorForAckTest) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
ReadAckFrame firstReceivedAck; ReadAckFrame firstReceivedAck;
firstReceivedAck.largestAcked = 100; firstReceivedAck.largestAcked = 100;
@ -636,7 +644,7 @@ TEST_P(AckHandlersTest, NoNewAckedPacket) {
PacketNum packetAfterRtoNum = 10; PacketNum packetAfterRtoNum = 10;
auto packetAfterRto = createNewPacket(packetAfterRtoNum, GetParam()); auto packetAfterRto = createNewPacket(packetAfterRtoNum, GetParam());
conn.outstandings.packetCount[packetAfterRto.header.getPacketNumberSpace()]++; conn.outstandings.packetCount[packetAfterRto.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(packetAfterRto), std::move(packetAfterRto),
Clock::now(), Clock::now(),
0, 0,
@ -647,7 +655,8 @@ TEST_P(AckHandlersTest, NoNewAckedPacket) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
ReadAckFrame ackFrame; ReadAckFrame ackFrame;
ackFrame.largestAcked = 5; ackFrame.largestAcked = 5;
@ -704,7 +713,8 @@ TEST_P(AckHandlersTest, AckPacketNumDoesNotExist) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
PacketNum packetNum2 = 10; PacketNum packetNum2 = 10;
auto regularPacket2 = createNewPacket(packetNum2, GetParam()); auto regularPacket2 = createNewPacket(packetNum2, GetParam());
@ -720,7 +730,8 @@ TEST_P(AckHandlersTest, AckPacketNumDoesNotExist) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
// Ack a packet one higher than the packet so that we don't trigger reordering // Ack a packet one higher than the packet so that we don't trigger reordering
// threshold. // threshold.
@ -761,7 +772,8 @@ TEST_P(AckHandlersTest, TestHandshakeCounterUpdate) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
} }
ReadAckFrame ackFrame; ReadAckFrame ackFrame;
@ -845,7 +857,7 @@ TEST_P(AckHandlersTest, NoSkipAckVisitor) {
WriteStreamFrame frame(0, 0, 0, true); WriteStreamFrame frame(0, 0, 0, true);
regularPacket.frames.emplace_back(std::move(frame)); regularPacket.frames.emplace_back(std::move(frame));
conn.outstandings.packetCount[regularPacket.header.getPacketNumberSpace()]++; conn.outstandings.packetCount[regularPacket.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(regularPacket), std::move(regularPacket),
Clock::now(), Clock::now(),
1, 1,
@ -856,7 +868,8 @@ TEST_P(AckHandlersTest, NoSkipAckVisitor) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
ReadAckFrame ackFrame; ReadAckFrame ackFrame;
ackFrame.largestAcked = 0; ackFrame.largestAcked = 0;
ackFrame.ackBlocks.emplace_back(0, 0); ackFrame.ackBlocks.emplace_back(0, 0);
@ -914,7 +927,8 @@ TEST_P(AckHandlersTest, SkipAckVisitor) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
// Give this outstandingPacket an associatedEvent that's not in // Give this outstandingPacket an associatedEvent that's not in
// outstandings.packetEvents // outstandings.packetEvents
outstandingPacket.associatedEvent.emplace(GetParam(), 0); outstandingPacket.associatedEvent.emplace(GetParam(), 0);
@ -965,7 +979,8 @@ TEST_P(AckHandlersTest, NoDoubleProcess) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
outstandingPacket1.associatedEvent.emplace(GetParam(), packetNum1); outstandingPacket1.associatedEvent.emplace(GetParam(), packetNum1);
OutstandingPacket outstandingPacket2( OutstandingPacket outstandingPacket2(
@ -979,7 +994,8 @@ TEST_P(AckHandlersTest, NoDoubleProcess) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
// The seconds packet has the same PacketEvent // The seconds packet has the same PacketEvent
outstandingPacket2.associatedEvent.emplace(GetParam(), packetNum1); outstandingPacket2.associatedEvent.emplace(GetParam(), packetNum1);
@ -1045,7 +1061,8 @@ TEST_P(AckHandlersTest, ClonedPacketsCounter) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
outstandingPacket1.associatedEvent.emplace(GetParam(), packetNum1); outstandingPacket1.associatedEvent.emplace(GetParam(), packetNum1);
conn.ackStates.appDataAckState.nextPacketNum++; conn.ackStates.appDataAckState.nextPacketNum++;
@ -1063,7 +1080,8 @@ TEST_P(AckHandlersTest, ClonedPacketsCounter) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
conn.outstandings conn.outstandings
.packetCount[outstandingPacket1.packet.header.getPacketNumberSpace()]++; .packetCount[outstandingPacket1.packet.header.getPacketNumberSpace()]++;
@ -1105,7 +1123,7 @@ TEST_P(AckHandlersTest, UpdateMaxAckDelay) {
auto regularPacket = createNewPacket(packetNum, GetParam()); auto regularPacket = createNewPacket(packetNum, GetParam());
auto sentTime = Clock::now(); auto sentTime = Clock::now();
conn.outstandings.packetCount[regularPacket.header.getPacketNumberSpace()]++; conn.outstandings.packetCount[regularPacket.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(regularPacket), std::move(regularPacket),
sentTime, sentTime,
1, 1,
@ -1116,7 +1134,8 @@ TEST_P(AckHandlersTest, UpdateMaxAckDelay) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
ReadAckFrame ackFrame; ReadAckFrame ackFrame;
// ackDelay has no effect on mrtt // ackDelay has no effect on mrtt
@ -1186,7 +1205,8 @@ TEST_P(AckHandlersTest, AckNotOutstandingButLoss) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
conn.outstandings.packets.push_back(std::move(outstandingPacket)); conn.outstandings.packets.push_back(std::move(outstandingPacket));
conn.outstandings.packetCount[GetParam()]++; conn.outstandings.packetCount[GetParam()]++;
@ -1227,7 +1247,7 @@ TEST_P(AckHandlersTest, UpdatePendingAckStates) {
auto regularPacket = createNewPacket(packetNum, GetParam()); auto regularPacket = createNewPacket(packetNum, GetParam());
auto sentTime = Clock::now() - 1500ms; auto sentTime = Clock::now() - 1500ms;
conn.outstandings.packetCount[regularPacket.header.getPacketNumberSpace()]++; conn.outstandings.packetCount[regularPacket.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(regularPacket), std::move(regularPacket),
sentTime, sentTime,
111, 111,
@ -1238,7 +1258,8 @@ TEST_P(AckHandlersTest, UpdatePendingAckStates) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
conn.lossState.totalBytesSent += 111; conn.lossState.totalBytesSent += 111;
conn.lossState.totalBodyBytesSent += 100; conn.lossState.totalBodyBytesSent += 100;
@ -1384,7 +1405,8 @@ TEST_P(AckHandlersTest, ImplictAckEventCreation) {
packetNum + 1, packetNum + 1,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
sentPacket.isAppLimited = (packetNum % 2); sentPacket.isAppLimited = (packetNum % 2);
conn.outstandings.packets.emplace_back(sentPacket); conn.outstandings.packets.emplace_back(sentPacket);
packetNum++; packetNum++;
@ -1456,7 +1478,8 @@ TEST_P(AckHandlersTest, TestRTTPacketObserverCallback) {
packetNum + 1, packetNum + 1,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
sentPacket.isAppLimited = false; sentPacket.isAppLimited = false;
conn.outstandings.packets.emplace_back(sentPacket); conn.outstandings.packets.emplace_back(sentPacket);
packetNum++; packetNum++;
@ -1729,7 +1752,7 @@ TEST_P(AckHandlersTest, SubMicrosecondRTT) {
auto packetSendTime = Clock::now(); auto packetSendTime = Clock::now();
auto packet = createNewPacket(5, GetParam()); auto packet = createNewPacket(5, GetParam());
conn.outstandings.packetCount[packet.header.getPacketNumberSpace()]++; conn.outstandings.packetCount[packet.header.getPacketNumberSpace()]++;
conn.outstandings.packets.emplace_back(OutstandingPacket( conn.outstandings.packets.emplace_back(
std::move(packet), std::move(packet),
packetSendTime, packetSendTime,
0, 0,
@ -1740,7 +1763,8 @@ TEST_P(AckHandlersTest, SubMicrosecondRTT) {
0, 0,
0, 0,
LossState(), LossState(),
0)); 0,
OutstandingPacketMetadata::DetailsPerStream());
ReadAckFrame ackFrame; ReadAckFrame ackFrame;
auto ackReceiveTime = packetSendTime + 400ns; auto ackReceiveTime = packetSendTime + 400ns;

View File

@ -8,6 +8,7 @@
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "quic/state/OutstandingPacket.h"
#include <quic/common/test/TestUtils.h> #include <quic/common/test/TestUtils.h>
#include <quic/fizz/server/handshake/FizzServerQuicHandshakeContext.h> #include <quic/fizz/server/handshake/FizzServerQuicHandshakeContext.h>
@ -705,7 +706,8 @@ TEST_F(QuicStateFunctionsTest, GetOutstandingPackets) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
conn.outstandings.packets.emplace_back( conn.outstandings.packets.emplace_back(
makeTestLongPacket(LongHeader::Types::Handshake), makeTestLongPacket(LongHeader::Types::Handshake),
Clock::now(), Clock::now(),
@ -717,7 +719,8 @@ TEST_F(QuicStateFunctionsTest, GetOutstandingPackets) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
conn.outstandings.packets.emplace_back( conn.outstandings.packets.emplace_back(
makeTestShortPacket(), makeTestShortPacket(),
Clock::now(), Clock::now(),
@ -729,7 +732,8 @@ TEST_F(QuicStateFunctionsTest, GetOutstandingPackets) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
conn.outstandings.packets.emplace_back( conn.outstandings.packets.emplace_back(
makeTestLongPacket(LongHeader::Types::Initial), makeTestLongPacket(LongHeader::Types::Initial),
Clock::now(), Clock::now(),
@ -741,7 +745,8 @@ TEST_F(QuicStateFunctionsTest, GetOutstandingPackets) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
conn.outstandings.packets.emplace_back( conn.outstandings.packets.emplace_back(
makeTestShortPacket(), makeTestShortPacket(),
Clock::now(), Clock::now(),
@ -753,7 +758,8 @@ TEST_F(QuicStateFunctionsTest, GetOutstandingPackets) {
0, 0,
0, 0,
LossState(), LossState(),
0); 0,
OutstandingPacketMetadata::DetailsPerStream());
EXPECT_EQ( EXPECT_EQ(
135, 135,
getFirstOutstandingPacket(conn, PacketNumberSpace::Initial) getFirstOutstandingPacket(conn, PacketNumberSpace::Initial)

View File

@ -37,7 +37,18 @@ TEST_F(StateDataTest, SingleLostPacketEvent) {
100, 100,
kVersion)); kVersion));
OutstandingPacket outstandingPacket( OutstandingPacket outstandingPacket(
packet, Clock::now(), 1234, 0, false, 1234, 0, 0, 0, LossState(), 0); packet,
Clock::now(),
1234,
0,
false,
1234,
0,
0,
0,
LossState(),
0,
OutstandingPacketMetadata::DetailsPerStream());
CongestionController::LossEvent loss; CongestionController::LossEvent loss;
loss.addLostPacket(outstandingPacket); loss.addLostPacket(outstandingPacket);
EXPECT_EQ(1234, loss.lostBytes); EXPECT_EQ(1234, loss.lostBytes);
@ -52,7 +63,18 @@ TEST_F(StateDataTest, MultipleLostPacketsEvent) {
100, 100,
kVersion)); kVersion));
OutstandingPacket outstandingPacket1( OutstandingPacket outstandingPacket1(
packet1, Clock::now(), 1234, 0, false, 1234, 0, 0, 0, LossState(), 0); packet1,
Clock::now(),
1234,
0,
false,
1234,
0,
0,
0,
LossState(),
0,
OutstandingPacketMetadata::DetailsPerStream());
RegularQuicWritePacket packet2(LongHeader( RegularQuicWritePacket packet2(LongHeader(
LongHeader::Types::Initial, LongHeader::Types::Initial,
@ -61,7 +83,18 @@ TEST_F(StateDataTest, MultipleLostPacketsEvent) {
110, 110,
kVersion)); kVersion));
OutstandingPacket outstandingPacket2( OutstandingPacket outstandingPacket2(
packet2, Clock::now(), 1357, 0, false, 1357, 0, 0, 0, LossState(), 0); packet2,
Clock::now(),
1357,
0,
false,
1357,
0,
0,
0,
LossState(),
0,
OutstandingPacketMetadata::DetailsPerStream());
CongestionController::LossEvent loss; CongestionController::LossEvent loss;
loss.addLostPacket(outstandingPacket1); loss.addLostPacket(outstandingPacket1);