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

Put outstanding packets, events and associated counters in one class

Summary: ^

Reviewed By: yangchi

Differential Revision: D21956286

fbshipit-source-id: 305b879ad11df23aae8e0c3aac4645c0136b3012
This commit is contained in:
Xiaoting Tang
2020-06-10 12:43:08 -07:00
committed by Facebook GitHub Bot
parent 621ad3bc0c
commit 2d00d56fbd
31 changed files with 473 additions and 465 deletions

View File

@@ -25,16 +25,16 @@ uint64_t PacketRebuilder::getHeaderBytes() const {
PacketEvent PacketRebuilder::cloneOutstandingPacket(OutstandingPacket& packet) {
// Either the packet has never been cloned before, or it's associatedEvent is
// still in the outstandingPacketEvents set.
// still in the outstandings.packetEvents set.
DCHECK(
!packet.associatedEvent ||
conn_.outstandingPacketEvents.count(*packet.associatedEvent));
conn_.outstandings.packetEvents.count(*packet.associatedEvent));
if (!packet.associatedEvent) {
auto packetNum = packet.packet.header.getPacketSequenceNum();
DCHECK(!conn_.outstandingPacketEvents.count(packetNum));
DCHECK(!conn_.outstandings.packetEvents.count(packetNum));
packet.associatedEvent = packetNum;
conn_.outstandingPacketEvents.insert(packetNum);
++conn_.outstandingClonedPacketsCount;
conn_.outstandings.packetEvents.insert(packetNum);
++conn_.outstandings.clonedPacketsCount;
}
return *packet.associatedEvent;
}