1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-25 15:43:13 +03:00

Custom variant type for packetheader

Summary:
Make a custom variant type for PacketHeader. By not relying on boost::variant
this reduces the code size of the implementation.

This uses a combination of a union type as well as a enum type to emulate a variant

Reviewed By: yangchi

Differential Revision: D17187589

fbshipit-source-id: 00c2b9b8dd3f3e73af766d84888b13b9d867165a
This commit is contained in:
Subodh Iyengar
2019-09-19 17:30:13 -07:00
committed by Facebook Github Bot
parent c8da36d755
commit 04baa15a04
39 changed files with 593 additions and 641 deletions

View File

@@ -361,7 +361,6 @@ TEST_F(DecodeTest, AckFrameMissingFields) {
ackBlocks.emplace_back(QuicInteger(10), QuicInteger(10));
ackBlocks.emplace_back(QuicInteger(10), QuicInteger(10));
auto header = makeHeader();
auto result1 = createAckFrame(
largestAcked,
folly::none,
@@ -373,7 +372,7 @@ TEST_F(DecodeTest, AckFrameMissingFields) {
EXPECT_THROW(
decodeAckFrame(
cursor1,
header,
makeHeader(),
CodecParameters(kDefaultAckDelayExponent, QuicVersion::MVFST)),
QuicTransportException);
@@ -383,7 +382,7 @@ TEST_F(DecodeTest, AckFrameMissingFields) {
EXPECT_THROW(
decodeAckFrame(
cursor2,
header,
makeHeader(),
CodecParameters(kDefaultAckDelayExponent, QuicVersion::MVFST)),
QuicTransportException);
@@ -393,7 +392,7 @@ TEST_F(DecodeTest, AckFrameMissingFields) {
EXPECT_THROW(
decodeAckFrame(
cursor3,
header,
makeHeader(),
CodecParameters(kDefaultAckDelayExponent, QuicVersion::MVFST)),
QuicTransportException);
@@ -403,7 +402,7 @@ TEST_F(DecodeTest, AckFrameMissingFields) {
EXPECT_THROW(
decodeAckFrame(
cursor4,
header,
makeHeader(),
CodecParameters(kDefaultAckDelayExponent, QuicVersion::MVFST)),
QuicTransportException);
@@ -413,7 +412,7 @@ TEST_F(DecodeTest, AckFrameMissingFields) {
EXPECT_THROW(
decodeAckFrame(
cursor5,
header,
makeHeader(),
CodecParameters(kDefaultAckDelayExponent, QuicVersion::MVFST)),
QuicTransportException);
}