mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-08-05 11:21:09 +03:00
send d6d probe packets via writeD6DProbingDataToSocket
Summary: This is the transport function that sends d6d probe to socket. It - checks if there's the pending event `sendD6DProbePacket`, which will be set by upon d6d's probe timer expiration. - uses the current probeSize to instantiate a D6DProbeScheduler, which will be changed by a small d6d state machine. Reviewed By: yangchi Differential Revision: D23193967 fbshipit-source-id: dfe6ce831cfd6ff0470e801644b95d4e8da34e87
This commit is contained in:
committed by
Facebook GitHub Bot
parent
23f817100a
commit
1aec6b57f0
@@ -2519,5 +2519,42 @@ TEST_F(QuicTransportFunctionsTest, WriteProbingWithInplaceBuilder) {
|
||||
EXPECT_EQ(conn->outstandings.packets.size(), outstandingPacketsCount + 3);
|
||||
}
|
||||
|
||||
TEST_F(QuicTransportFunctionsTest, WriteD6DProbesWithInplaceBuilder) {
|
||||
auto conn = createConn();
|
||||
conn->transportSettings.dataPathType = DataPathType::ContinuousMemory;
|
||||
conn->d6d.currentProbeSize = 1450;
|
||||
conn->pendingEvents.sendD6DProbePacket = true;
|
||||
auto simpleBufAccessor =
|
||||
std::make_unique<SimpleBufAccessor>(kDefaultMaxUDPPayload * 16);
|
||||
auto outputBuf = simpleBufAccessor->obtain();
|
||||
auto bufPtr = outputBuf.get();
|
||||
simpleBufAccessor->release(std::move(outputBuf));
|
||||
conn->bufAccessor = simpleBufAccessor.get();
|
||||
conn->transportSettings.batchingMode = QuicBatchingMode::BATCHING_MODE_GSO;
|
||||
EventBase evb;
|
||||
folly::test::MockAsyncUDPSocket mockSock(&evb);
|
||||
EXPECT_CALL(mockSock, getGSO()).WillRepeatedly(Return(true));
|
||||
EXPECT_CALL(mockSock, write(_, _))
|
||||
.Times(1)
|
||||
.WillOnce(Invoke([&](const SocketAddress&,
|
||||
const std::unique_ptr<folly::IOBuf>& sockBuf) {
|
||||
EXPECT_EQ(sockBuf->length(), conn->d6d.currentProbeSize);
|
||||
EXPECT_EQ(sockBuf.get(), bufPtr);
|
||||
EXPECT_TRUE(folly::IOBufEqualTo()(*sockBuf, *bufPtr));
|
||||
EXPECT_FALSE(sockBuf->isChained());
|
||||
return sockBuf->computeChainDataLength();
|
||||
}));
|
||||
writeD6DProbeToSocket(
|
||||
mockSock,
|
||||
*conn,
|
||||
*conn->clientConnectionId,
|
||||
*conn->serverConnectionId,
|
||||
*aead,
|
||||
*headerCipher,
|
||||
getVersion(*conn));
|
||||
EXPECT_EQ(0, bufPtr->length());
|
||||
EXPECT_EQ(0, bufPtr->headroom());
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace quic
|
||||
|
Reference in New Issue
Block a user