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

Remove throws from socket layer

Summary: More in the theme of returning Expected instead of throwing. For the folly case, we keep the try/catches in there and translate to Expected. For Libev, we convert directly to Expected.

Reviewed By: kvtsoy

Differential Revision: D73217128

fbshipit-source-id: d00a978f24e3b29a77a8ac99a19765ae49f64df8
This commit is contained in:
Matt Joras
2025-04-19 15:20:15 -07:00
committed by Facebook GitHub Bot
parent e196f31741
commit 089bf581a7
41 changed files with 2057 additions and 692 deletions

View File

@@ -163,6 +163,7 @@ TEST_F(QuicOpenStateTest, AckStream) {
EventBase evb;
auto qEvb = std::make_shared<FollyQuicEventBase>(&evb);
auto sock = std::make_unique<quic::test::MockAsyncUDPSocket>(qEvb);
ON_CALL(*sock, getGSO).WillByDefault(testing::Return(0));
auto buf = IOBuf::copyBuffer("hello");
writeQuicPacket(
@@ -200,6 +201,7 @@ TEST_F(QuicOpenStateTest, AckStreamMulti) {
EventBase evb;
auto qEvb = std::make_shared<FollyQuicEventBase>(&evb);
auto sock = std::make_unique<quic::test::MockAsyncUDPSocket>(qEvb);
ON_CALL(*sock, getGSO).WillByDefault(testing::Return(0));
auto buf = IOBuf::copyBuffer("hello");
writeQuicPacket(
@@ -264,6 +266,7 @@ TEST_F(QuicOpenStateTest, RetxBufferSortedAfterAck) {
EventBase evb;
auto qEvb = std::make_shared<FollyQuicEventBase>(&evb);
quic::test::MockAsyncUDPSocket socket(qEvb);
ON_CALL(socket, getGSO).WillByDefault(testing::Return(0));
Optional<ConnectionId> serverChosenConnId = *conn->clientConnectionId;
serverChosenConnId.value().data()[0] ^= 0x01;
@@ -581,6 +584,7 @@ TEST_F(QuicHalfClosedRemoteStateTest, AckStream) {
EventBase evb;
auto qEvb = std::make_shared<FollyQuicEventBase>(&evb);
auto sock = std::make_unique<quic::test::MockAsyncUDPSocket>(qEvb);
ON_CALL(*sock, getGSO).WillByDefault(testing::Return(0));
auto buf = IOBuf::copyBuffer("hello");
writeQuicPacket(