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

make largestAckedByPeer and largestSent optional

Summary: 0 is now a valid packet number, so we should make these optional. In cases where they are needed to construct packet builder, it should be safe to use 0 as default since it's only used for computing `twiceDistance` in PacketNumber.cpp.

Reviewed By: yangchi

Differential Revision: D21948454

fbshipit-source-id: af9fdc3e28ff85f1594296c4d436f24685a0acd6
This commit is contained in:
Xiaoting Tang
2020-06-10 10:28:08 -07:00
committed by Facebook GitHub Bot
parent dc2ef325b5
commit 03e3bb6547
15 changed files with 82 additions and 70 deletions

View File

@@ -120,7 +120,7 @@ auto buildEmptyPacket(
RegularQuicPacketBuilder builder(
conn.udpSendPacketLen,
std::move(*header),
getAckState(conn, pnSpace).largestAckedByPeer);
getAckState(conn, pnSpace).largestAckedByPeer.value_or(0));
builder.encodePacketHeader();
DCHECK(builder.canBuildPacket());
return std::move(builder).buildPacket();