mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-08-06 22:22:38 +03:00
Always call writeGSO
Summary: There's no need to call write when there's only one packet, since write just wraps writeGSO. This simplifies the use of options and will allow for setting a TXTIME when there's only one packet to send. Reviewed By: kvtsoy Differential Revision: D48526018 fbshipit-source-id: d934ddce8d3a35febb58ff253fc7a9bed3ef975c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
646bd89e65
commit
df49cb664f
@@ -515,10 +515,11 @@ TEST_P(QuicBatchWriterTest, InplaceWriterWriteOne) {
|
||||
ASSERT_FALSE(
|
||||
batchWriter->append(nullptr, 1000, folly::SocketAddress(), nullptr));
|
||||
|
||||
EXPECT_CALL(sock, write(_, _))
|
||||
EXPECT_CALL(sock, writeGSO(_, _, _))
|
||||
.Times(1)
|
||||
.WillOnce(Invoke([&](const auto& /* addr */,
|
||||
const std::unique_ptr<folly::IOBuf>& buf) {
|
||||
const std::unique_ptr<folly::IOBuf>& buf,
|
||||
auto) {
|
||||
EXPECT_EQ(1000, buf->length());
|
||||
return 1000;
|
||||
}));
|
||||
@@ -606,10 +607,11 @@ TEST_P(QuicBatchWriterTest, InplaceWriterBufResidueCheck) {
|
||||
rawBuf->append(packetSizeBig);
|
||||
EXPECT_TRUE(batchWriter->needsFlush(packetSizeBig));
|
||||
|
||||
EXPECT_CALL(sock, write(_, _))
|
||||
EXPECT_CALL(sock, writeGSO(_, _, _))
|
||||
.Times(1)
|
||||
.WillOnce(Invoke([&](const auto& /* addr */,
|
||||
const std::unique_ptr<folly::IOBuf>& buf) {
|
||||
const std::unique_ptr<folly::IOBuf>& buf,
|
||||
auto) {
|
||||
EXPECT_EQ(700, buf->length());
|
||||
return 700;
|
||||
}));
|
||||
|
Reference in New Issue
Block a user