mozilla / neqo

Neqo, the Mozilla Firefox implementation of QUIC in Rust
https://firefox-source-docs.mozilla.org/networking/http/http3.html
Apache License 2.0
1.85k stars 124 forks source link

`send()` returns `Ok(())` on IO errors #2236

Open KershawChang opened 2 hours ago

KershawChang commented 2 hours ago

https://github.com/quinn-rs/quinn/blob/3a9d176a7a131a1f6d9472c1a23fccdcb1275b52/quinn-udp/src/unix.rs#L215

If I understand the code correctly, quinn-udp returns Ok(()) for any IO error except WouldBlock. This behavior causes issues within Firefox, as certain parts of the code rely on the underlying error codes (e.g., NS_ERROR_CONNECTION_REFUSED) to handle specific scenarios appropriately.

KershawChang commented 2 hours ago

It appears that we just need to use try_send instead of send below. https://github.com/mozilla/neqo/blob/7a25525b3d368d99f19a1aa1829a5fa21c019ad9/neqo-udp/src/lib.rs#L38