* Introduce UnorderedRecvStream newtype and remove unordered flag from recv_chunk
The only way to do unordered reads is now via the UnorderedRecvStream.
UnorderedRecvStream duplicates the API of RecvStream related to stream state
* Fix bench
* Update quinn/src/recv_stream.rs
Co-authored-by: Floris Bruynooghe <flub@n0.computer>
* Update quinn/src/recv_stream.rs
Co-authored-by: Floris Bruynooghe <flub@n0.computer>
* Add links to docs.
* Add doc comment to UnorderedRecvStream.
* Remove IllegalOrderedRead in quinn.
We do not remove ReadableError::IllegalOrderedRead in quinn-proto, since
using the current quinn-proto API you can still get it.
So we need to panic in the (single) place where we convert a ReadableError
to a ReadError.
* Move struct definition closer to impl
---------
Co-authored-by: Floris Bruynooghe <flub@n0.computer>
* Take semver-compatible dependency updates
* proto: use new constructor where possible
* proto: drop unused From impl
* quinn: import more types
* quinn: remove indirection in connection initialization
---------
Co-authored-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
* chore: add more Debug derives
* fix: do not unconditionally use path 0 in APIs
* fix(quinn): reexport PathId
* fixup: debug for controllermetrics
* cleanup and remove `network_path_changed` api
* clearly differentiate client and server states
This makes reasoning much easier since only the required fields are
present in the corresponding side state. It also reduces state size, now
it's 112 bytes, before it was 160 bytes
* apply clippy fixes
* fmt
* calculate this connection's mtu as the minimum across all paths
* add TODO to check buffer reserving
* improve docs
* apply clippy fixes
* more docs tweaks
* second perspective on TODO
* spelling
* address TODO: reserving is already done in poll_transmit with the appropiate sizes
* Fix remote addresses in paths
- Remove quinn_proto::Connection::remote_address. You should use
path_remote_address now.
- Change quinn::Connection::remote_address to return *any* remote
address from any of the open paths.
- Fix opening paths on IPv4 addresses, when the endpoint supports
IPv6.
When the endpoint supports IPv6 it uses IPv4-mapped IPv6 addresses
for IPv4 remotes. This is enforced when establishing a connection,
and quinn-udp automatically does this for incoming datagrams.
However when opening a path we should do the same mapping.
Otherwise we will end up with an IPv4 remote address in the PathData
and incoming datagrams will come from an IPv6 address and be
dropped.
* fix tests
* Fix WeakConnection::upgrade
It created a ConnectionRef that did not increment the manually-tracked
reference count inside the Arc<ConnectionInner>. This triggered the
ConnectionRef's Drop impl to actually drop the connection.
This works around this by using the fact that the ConnectionRef's
Clone impl does know how to manipulate the reference count in a way
that works together with the ConnectionRef's Drop. I think this is
preferred over manipulating the ref_count directly in the
WeakConnectionHandle since that code is closer by.
* Nicer implementation