1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-10 21:22:20 +03:00

iobufqueue diediedie

Summary:
Don't use IOBufQueue for most operations in mvfst and use BufQueue instead. Since BufQueue did not support a splitAtMost, added it in instead.

The only place that we still use IOBufQueue is in crypto because fizz still requires it

Reviewed By: mjoras

Differential Revision: D18846960

fbshipit-source-id: 4320b7f8614f8d2c75f6de0e6b786d33650e9656
This commit is contained in:
Subodh Iyengar
2019-12-06 12:04:23 -08:00
committed by Facebook Github Bot
parent cadedee2fd
commit e524c0c069
27 changed files with 109 additions and 69 deletions

View File

@@ -124,6 +124,37 @@ TEST_F(QuicReadCodecTest, RetryPacketTest) {
EXPECT_EQ(headerOut.getToken(), expected);
}
TEST_F(QuicReadCodecTest, LongHeaderPacketLenMismatch) {
LongHeader headerIn(
LongHeader::Types::Initial,
getTestConnectionId(70),
getTestConnectionId(90),
321,
QuicVersion::MVFST,
std::string("fluffydog"),
getTestConnectionId(110));
RegularQuicPacketBuilder builder(
kDefaultUDPSendPacketLen, std::move(headerIn), 0 /* largestAcked */);
builder.setCipherOverhead(0);
writeCryptoFrame(0, folly::IOBuf::copyBuffer("CHLO"), builder);
auto packet = packetToBuf(std::move(builder).buildPacket());
auto packetQueue = bufToQueue(std::move(packet));
auto tmp = packetQueue.move();
tmp->coalesce();
tmp->trimEnd(1);
packetQueue.append(std::move(tmp));
AckStates ackStates;
auto codec = makeUnencryptedCodec();
codec->setInitialReadCipher(createNoOpAead());
codec->setInitialHeaderCipher(test::createNoOpHeaderCipher());
auto result = codec->parsePacket(packetQueue, ackStates);
auto nothing = result.nothing();
EXPECT_NE(nothing, nullptr);
}
TEST_F(QuicReadCodecTest, EmptyVersionNegotiationPacketTest) {
auto srcConnId = getTestConnectionId(0), destConnId = getTestConnectionId(1);
std::vector<QuicVersion> versions;