Commit Graph

3653 Commits

Author SHA1 Message Date
Benjamin Saunders 835a65fac2 Perform early first-packet validation before decryption 2024-03-26 10:59:06 -07:00
Benjamin Saunders 36950c6bb1 Factor initial packet plain header fields out into a struct 2024-03-26 10:59:06 -07:00
Benjamin Saunders 95ac70d6b6 Factor out payload-independent connection refusal tests 2024-03-26 10:59:06 -07:00
Benjamin Saunders 990203b477 Bound memory use in RETIRE_CONNECTION_ID frame queue 2024-03-26 10:50:17 -07:00
Jamil a2a214b968 Enable all macos UDP features on ios 2024-03-23 11:40:29 -07:00
jean-airoldie a5b6fac103 Expose RecvStream::poll_read 2024-03-19 09:10:41 +01:00
jean-airoldie a100fc76da Improve poll_finish documentation 2024-03-17 08:31:00 +01:00
jean-airoldie 5dd70afc42 Expose SendStream::poll_write and poll_finish methods 2024-03-17 08:31:00 +01:00
Gabi ffac4a339c Enable packet info and related flags for quinn-udp on Android 2024-03-11 19:55:24 +00:00
Benjamin Saunders 62205e80d7 Encapsulate more congestion control logic inside PathData 2024-03-11 12:19:34 -07:00
Benjamin Saunders 214f694ce0 Maintain in-flight counters separately per path 2024-03-11 12:19:34 -07:00
Benjamin Saunders a19966ba07 Move Connection::remove_in_flight onto InFlight 2024-03-11 12:19:34 -07:00
Felician Nemeth 2e72f27bfd Fix constant of frame_type IMMEDIATE_ACK
Both the draft and the IANA registry say the current value for
frame_type IMMEDIATE_ACK is 0x1F.

https://www.iana.org/assignments/quic/quic.xhtml
https://datatracker.ietf.org/doc/html/draft-ietf-quic-ack-frequency#section-10.2

Co-Authored-By: Tamas Levai <levait@tmit.bme.hu>
2024-03-06 11:51:22 -08:00
Benjamin Saunders 9611c5ef69 Limit memory used to track sent ACKs when purely receiving 2024-02-29 11:09:51 -08:00
Benjamin Saunders e82ae58bb0 Update space in-flight counter in Space::take
Unifying this with removing a packet's tracking state is less
error-prone, and moves some responsibility out of the Connection
monolith.
2024-02-29 11:09:51 -08:00
Benjamin Saunders b50a7e426e Abstract out helper for removing sent packet state 2024-02-29 11:09:51 -08:00
Benjamin Saunders 06bd20d446 Occasionally ACK packets even when unprompted by peer 2024-02-29 11:09:51 -08:00
Benjamin Saunders b08d1089df Remove redundant assert 2024-02-29 11:09:51 -08:00
Benjamin Saunders cd69fa5260 Don't double-count buffer consumption in close length checks
PacketBuilder::max_size previously subtracted out the start index and
header size of the packet, and therefore described the admissible size
of the packet's frames. However, most of our logic operates in terms
of absolute buffer positions instead. This was confusing, and led to
erroneous double-counting of space use in close packets.
2024-02-25 00:04:26 -08:00
Benjamin Saunders 1ed8e976eb Test closing incoming connections before a response is sent 2024-02-24 23:59:31 -08:00
Benjamin Saunders 88e6958a7d Allow detailed transport-layer errors in insecure spaces
Required for reliable delivery of e.g. handshake errors.
2024-02-24 23:59:31 -08:00
Benjamin Saunders 0b1116be21 Improve reliability of Close delivery during handshakes 2024-02-24 23:59:31 -08:00
Max Inden a947962131 fix(quinn-udp): use TOS for IPv4-mapped IPv6 dst addrs 2024-02-22 12:28:44 -08:00
Benjamin Saunders 614fef62f7 Document cancel-safety of stream I/O operations 2024-02-21 09:56:49 +01:00
dependabot[bot] dcc8048974 build(deps): bump codecov/codecov-action from 3 to 4
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 15:02:55 +01:00
Benjamin Saunders 1c7c46049c Send path validation responses to the correct remote 2024-01-25 11:01:07 +01:00
Benjamin Saunders d95c65e6f0 Factor out helper structure for path validation responses 2024-01-25 11:01:07 +01:00
Benjamin Saunders bfd1b24769 Move PathResponse into mod paths 2024-01-25 11:01:07 +01:00
Benjamin Saunders ebc1b9d684 Reduce coercion 2024-01-25 11:01:07 +01:00
Benjamin Saunders eeb12911ac Factor out udp_tx stats update 2024-01-25 11:01:07 +01:00
Benjamin Saunders 268cfb9981 Don't shadow builder storage in poll_transmit 2024-01-25 11:01:07 +01:00
Al Liu 2e4074afb1 Copy the AsyncStdRuntime module to create SmolRuntime 2024-01-24 23:34:34 +01:00
Al Liu b2e0667cb5 Wrap AsyncStdRuntime in an inline module, in place 2024-01-24 23:34:34 +01:00
Al Liu 3fded56a6d Introduce UdpSocket::new() and use it in the AsyncStdRuntime impl 2024-01-24 23:34:34 +01:00
Phoenix Kahlo 597b10b2d5 Fix parsing of IPV6 URLs in client example
Currently, when trying to run the client example with an IPV6 address
URL, such as by running:

    cargo run --example client https://[::1]:4433/Cargo.toml --host localhost

A "failed to lookup address information: Name or service not known"
error is raised. This is because `url.host_str()` is `"[::1]"`, which
is wrapped in brackets. These brackets, specified by by RFC 2732, are
part of the URL syntax, not the IP address syntax.

Although this code succeeds, because the standard library treats this
like a URL:

    use std::net::ToSocketAddrs;
    "[::1]:4433".to_socket_addrs()

This code does not:

    use std::net::Ipv6Addr;
    "[::1]".parse::<Ipv6Addr>()

As the stdlib expects to just receive "::1". Consequentially, this
does not succeed, counterintuitively:

    use std::net::ToSocketAddrs;
    ("[::1]", 4433).to_socket_addrs()

This code fixes the client example's URL parsing behavior by
stripping out such brackets in the same way as [is done in
tokio-tungstenite][1].

[1]: https://github.com/snapview/tokio-tungstenite/blob/052d085aff4708b924b92becaa83923b15045841/src/lib.rs#L404
2024-01-20 18:15:03 -08:00
Benjamin Saunders 2a1b614c01 Document two more commonly-observed mistakes in RecvStream use 2024-01-19 09:27:48 +01:00
Benjamin Saunders b5dd5a978b Replace rustls-native-certs with rustls-platform-verifier 2024-01-18 07:52:09 +01:00
Benjamin Saunders 66cb4a964a udp: Expand crate documentation 2024-01-17 13:27:15 -08:00
Damien Deville 20dff915e1 udp: use io::Result<> where possible 2024-01-08 11:14:52 -08:00
Damien Deville 6e3d10857e udp: make basic test work even if Ipv6 support is disabled 2024-01-04 11:26:22 -08:00
Benjamin Saunders 2105122224 udp: support GRO on Windows 2024-01-04 11:26:22 -08:00
Benjamin Saunders 33f6d89cf4 udp: support GSO on Windows 2024-01-04 11:26:22 -08:00
Benjamin Saunders 25c21a2297 udp: test GSO support 2024-01-04 11:26:22 -08:00
Benjamin Saunders 7dc8edb37e udp: handle GRO in tests 2024-01-04 11:26:22 -08:00
Benjamin Saunders d2aae4d6e7 udp: tolerate true IPv4 dest addrs when dual-stack 2024-01-04 11:26:22 -08:00
Benjamin Saunders 1362483650 udp: don't test setting ECN CE codepoint
This is not required for QUIC, and perhaps always incorrect. Further,
Windows drops packets that we attempt to send with CE set.
2024-01-04 11:26:22 -08:00
Damien Deville 8dfb63b4c7 udp: Windows support for ECN and local addrs 2024-01-04 11:26:22 -08:00
Damien Deville aa3b2e3e82 udp: add helper function to set option on windows socket 2024-01-04 11:26:22 -08:00
Damien Deville 06630aa025 udp: move newly generic code so it can be reused 2024-01-04 11:26:22 -08:00
Damien Deville ede912a577 udp: preparation work to make cmsg Encoder / decode / Iter generic 2024-01-04 11:26:22 -08:00