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

20 Commits

Author SHA1 Message Date
Konstantin Tsoy
5f59ee7eff use the new errnoStr function
Summary: instead of the folly one

Reviewed By: sharmafb

Differential Revision: D80305359

fbshipit-source-id: 02f4780ed32874e00bcea13b5af4103560d7d205
2025-08-26 09:09:38 -07:00
Richard Barnes
393fae3277 Fix unused-return in pymk/scripts/local_testing/SendLeafRequest.cpp +5
Summary:
LLVM has a warning `-Wunreachable-code-return` which identifies return statements that cannot be reached.

In innocuous situations such statements are often present:
* to satisfy a compiler warning that existed before `[[noreturn]]` was introduced. Now that we have `[[noreturn]]`, this use is not necessary.
* to specify a return type. But there are clearer ways to do this.
* in place of the more legible `__builtin_unreachable()` (which will soon become `std::unreachable()`). In this case, we should use the more legible alternative.
* because the programmer was afraid of the function unexpectedly returning. But we check for this condition with `-Wreturn-type`.

In dangerous situations such statements can obscure the intended execution of the program or even hide an erroneous early return.

In this diff, we remove one or more unreachable returns.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: hanidamlaj

Differential Revision: D80557705

fbshipit-source-id: ab7adc3c1108f28e9e4d22e1c046c28d589b2330
2025-08-20 15:16:18 -07:00
Joseph Beshay
895d9e1473 Fix LibevQuicAsyncUDPSocket connect()
Summary:
- Mark the socket as bound_ when connect() succeeds.
- FIx the length used for sockaddr for IPv6 when connecting or reading back the local address

Reviewed By: mjoras

Differential Revision: D79825831

fbshipit-source-id: c9d05af9b8c8bc479f760cc2e34566f450e2613e
2025-08-08 10:17:51 -07:00
Matt Joras
4601c4bdae Migrate folly::Expected to quic::Expected
Summary:
This migrates the quic code to use quic::Expected instead of folly::Expected. quic::Expected is a vendored wrapper for expected-lite, which itself matches std::expected. std::expected is not available to us, but once it is, we would be able to further simplify to the std version.

This migration is almost entirely mechanical.
 ---
> Generated by [Confucius Code Assist (CCA)](https://www.internalfb.com/wiki/Confucius/Analect/Shared_Analects/Confucius_Code_Assist_(CCA)/)
[Session](https://www.internalfb.com/confucius?session_id=7044a18e-4d22-11f0-afeb-97de80927172&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=7044a18e-4d22-11f0-afeb-97de80927172&tab=Trace)
 ---
> Generated by [RACER](https://www.internalfb.com/wiki/RACER_(Risk-Aware_Code_Editing_and_Refactoring)/), powered by [Confucius](https://www.internalfb.com/wiki/Confucius/Analect/Shared_Analects/Confucius_Code_Assist_(CCA)/)
[Session](https://www.internalfb.com/confucius?session_id=1fea6620-4d30-11f0-a206-ad0241db9ec9&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=1fea6620-4d30-11f0-a206-ad0241db9ec9&tab=Trace)
[Session](https://www.internalfb.com/confucius?session_id=2bdbabba-505a-11f0-a21b-fb3d40195e00&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=2bdbabba-505a-11f0-a21b-fb3d40195e00&tab=Trace)
[Session](https://www.internalfb.com/confucius?session_id=eb689fd2-5114-11f0-ade8-99c0fe2f80f2&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=eb689fd2-5114-11f0-ade8-99c0fe2f80f2&tab=Trace)
[Session](https://www.internalfb.com/confucius?session_id=9bc2dcec-51f8-11f0-8604-7bc1f5225a86&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=9bc2dcec-51f8-11f0-8604-7bc1f5225a86&tab=Trace)
[Session](https://www.internalfb.com/confucius?session_id=46b187ea-5cdd-11f0-9bab-7b6b886e8a09&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=46b187ea-5cdd-11f0-9bab-7b6b886e8a09&tab=Trace)

Reviewed By: kvtsoy

Differential Revision: D76488955

fbshipit-source-id: 92b9cbeac85a28722a6180464b47d84696b1e81b
2025-07-10 15:57:07 -07:00
Crystal Jin
2976801438 Clean up recvfrom option
Reviewed By: kvtsoy

Differential Revision: D77028366

fbshipit-source-id: 554fb6f4dbe18cfd12503c828b1a7eca7467b0ca
2025-06-24 15:59:16 -07:00
Konstantin Tsoy
fd8187143a use std::function in base transport
Summary: use std::function in base transport

Reviewed By: mjoras

Differential Revision: D73380174

fbshipit-source-id: 2e51c8bd28c3b7387908cfb04008836f0e6daccf
2025-04-22 20:44:16 -07:00
Matt Joras
089bf581a7 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
2025-04-19 15:20:15 -07:00
Paul Farcasanu
362340c32c log whether quic socket readable
Summary:
**Context**: adding more debugging to catch the 0RTT bug.

Wonder if the client is down to read more data. There could presumably be some bug with 0RTT + happy eyeballs where the socket isnt working.

Reviewed By: lnicco

Differential Revision: D72266611

fbshipit-source-id: 6420017efcb200dd04bb7070c6c31049bcee8148
2025-04-03 11:45:33 -07:00
Aman Sharma
69d9467c0c Move SendmmsgPacketBatchWriter to sendmsg with iovecs
Summary: I'm switching the usages of `writem` to use iovecs instead of IOBufs.

Reviewed By: kvtsoy

Differential Revision: D68857701

fbshipit-source-id: 96461aac85f39da9b85e16f2927b4539e712e5cb
2025-01-30 14:51:03 -08:00
Crystal Jin
25c2ea70f9 Add recvfrom option
Reviewed By: kvtsoy

Differential Revision: D65234259

fbshipit-source-id: 012b8de53e2192f7acec9999fd144a24c98da23a
2024-10-31 14:14:24 -07:00
Aman Sharma
2369ecb69b Use iovec instead of IOBuf in QuicAsyncUDPSocket::write and QuicAsyncUDPSocket::writeGSO
Summary: See title

Reviewed By: mjoras

Differential Revision: D61048705

fbshipit-source-id: 60dc63cc67f63be6f0ac6cbe0e766172a8c79d7c
2024-10-02 15:13:23 -07:00
Joseph Beshay
96ae54f2a9 Decide how to implement recvmmsg in runtime
Summary:
FOLLY_HAVE_RECVMMSG is no longer available: D59072339.

This changes LibevQuicAsyncUDPSocket to use recvmmsg and implement it using recvmsg in runtime if it's not available.

Reviewed By: kvtsoy

Differential Revision: D59527136

fbshipit-source-id: 18acc3af74a8782531b92b71aaa9bc0e0dfd8019
2024-07-10 17:03:05 -07:00
Matt Joras
aefc9e369b Introduce quic::Optional
Summary:
The idea here is to make it so we can swap out the type we are using for optionality. In the near term we are going to try swapping towards one that more aggressively tries to save size.

For now there is no functional change and this is just a big aliasing diff.

Reviewed By: sharmafb

Differential Revision: D57633896

fbshipit-source-id: 6eae5953d47395b390016e59cf9d639f3b6c8cfe
2024-06-11 11:02:02 -07:00
Joseph Beshay
24853da2fc Use two separate watchers for read and write
Summary: As title.

Reviewed By: kvtsoy

Differential Revision: D57628907

fbshipit-source-id: 695dda724d3e3d6719a19b8274148772063b82cd
2024-05-22 15:35:32 -07:00
Konstantin Tsoy
3240f33387 Writable events impl for LibevQuicAsyncUDPSocket
Summary: Writable events impl for LibevQuicAsyncUDPSocket

Reviewed By: jbeshay

Differential Revision: D56373378

fbshipit-source-id: badc774d24b64b0a5046483434a29c93549a34aa
2024-05-21 10:40:11 -07:00
Joseph Beshay
cad7327384 Support ErrMessageCallback in LibevQuicAsyncUDPSocket
Summary: As title. The functionality is mostly copied over from folly::AsyncUDPSocket.

Reviewed By: kvtsoy

Differential Revision: D54832808

fbshipit-source-id: c2ee71b28c64f26b826d544771593c9c1d3135ef
2024-03-13 14:25:18 -07:00
Konstantin Tsoy
d6bebfc41f Implement snd/recv sock buf setters
Summary: Implement snd/recv sock buf setters

Reviewed By: mjoras

Differential Revision: D54783590

fbshipit-source-id: 06ab1510d38b0e370e6c0ab8971f21944b95fcfd
2024-03-11 21:51:53 -07:00
Joseph Beshay
42a59f9a45 Fix LibevQuicAsyncUDPSocket write for macOS
Summary: Previously, writing would fail due to the wrong address size being used. This fixes it.

Reviewed By: lhuang04

Differential Revision: D53627612

fbshipit-source-id: cecbecd210580287336d0e72f486b1044bffb035
2024-02-09 16:31:52 -08:00
Matt Joras
e758a074e3 Don't log for GRO/timestamping not implemented
Summary:
It's fine to just return that it didn't work.

(Note: this ignores all push blocking failures!)

Reviewed By: kvtsoy

Differential Revision: D53298640

fbshipit-source-id: 7a25351a716541c1f028c28c40be30fde821b5cd
2024-01-31 21:04:21 -08:00
Joseph Beshay
0b4b1ae8e4 Add LibevQuicAsyncUDPSocket implementation
Summary: Introduces LibevQuicAsyncUDPSocket; a pure libc socket wrapper that implements QuicAsyncUDPSocket that is driven by LibevQuicEventBase.

Reviewed By: mjoras

Differential Revision: D51285024

fbshipit-source-id: 92c5ef6e8d0ed051624a60a1854d0805df31894e
2023-12-14 00:24:12 -08:00