1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-24 04:01:07 +03:00

Mostly remove folly::Optional

Summary:
This is an API break, but it should mostly be a manageable one. We want to be able to compile mvfst internally without exceptions, and folly::Optional is one dependency that makes this challenging. Additionally, we already have an imported secondary optional type for performance/struct size reasons, tiny-optional.

This second optional interface is mostly compatible in an API sense (including the use of std::nullopt) with std::optional. Thus our approach is to remove the dependency on folly::Optional, and offer a quic::Optional instead.

The next diff will properly vendor tiny-optional so that quic::Optional is an independent version of it.

Reviewed By: sharmafb, kvtsoy

Differential Revision: D74133131

fbshipit-source-id: 715f8bb5043ba3bb876cacfe54236887e0686b30
This commit is contained in:
Matt Joras
2025-05-07 23:01:49 -07:00
committed by Facebook GitHub Bot
parent d306793640
commit 9a9dcca57c
159 changed files with 1502 additions and 1209 deletions

View File

@@ -965,12 +965,12 @@ TEST_F(QuicStateFunctionsTest, RttCalculationExtraRttMetricsStoredInLossState) {
// 1 | 31ms (5 ms) | 26ms || 31 | 26 | (both)
// 2 | 30ms (3 ms) | 27ms || 30 | 26 | (1)
// 3 | 30ms (8 ms) | 22ms || 30 | 22 | (2)
// 4 | 37ms (8 ms) | 29ms || 30 | 22 | (none)
// 5 | 25ms (0 ms) | 29ms || 25 | 22 | (1)
// 6 | 25ms (4 ms) | 29ms || 25 | 21 | (2)
// 7 | 20ms (0 ms) | 29ms || 20 | 20 | (both)
// 8 | 0ms (0 ms) | 0ms || 0 | 0 | (both)
// 9 | 0ms (10 ms) | 0ms || 0 | 0 | (none)
// 4 | 37ms (8 ms) | 29ms || 30 | 22 |
// (std::nullopt) 5 | 25ms (0 ms) | 29ms || 25 | 22 |
// (1) 6 | 25ms (4 ms) | 29ms || 25 | 21 | (2) 7
// | 20ms (0 ms) | 29ms || 20 | 20 | (both) 8 |
// 0ms (0 ms) | 0ms || 0 | 0 | (both) 9 | 0ms
// (10 ms) | 0ms || 0 | 0 | (std::nullopt)
// case 1
updateRtt(conn, 31ms /* RTT sample */, 5ms /* ack delay */);
@@ -1075,7 +1075,7 @@ TEST_F(QuicStateFunctionsTest, TestInvokeStreamStateMachineStreamError) {
FizzServerQuicHandshakeContext::Builder().build());
QuicStreamState stream(1, conn);
RstStreamFrame rst(1, GenericApplicationErrorCode::UNKNOWN, 100);
auto result = sendRstAckSMHandler(stream, folly::none);
auto result = sendRstAckSMHandler(stream, std::nullopt);
ASSERT_TRUE(result.hasError());
ASSERT_NE(result.error().code.asTransportErrorCode(), nullptr);
EXPECT_EQ(