* make transport config and transport parameters uniform
* remove comment from docs
* keep track of the local and remote max path ids
* add constant
* clippy fixes
Clippy is warning that the size of RetryError (both proto and quinn's
versions) are excessively large for a Result Err variant. This function
fixes these warnings by boxing the contents of both.
This commit uses an allow directive to suppress the following error:
```
warning: the `Err`-variant returned from this function is very large
--> quinn-proto/src/endpoint.rs:525:10
|
525 | ) -> Result<(ConnectionHandle, Connection), AcceptError> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 136 bytes
|
= help: try reducing the size of `endpoint::AcceptError`, for example by boxing large elements or replacing it with `Box<endpoint::AcceptError>`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err
= note: `#[warn(clippy::result_large_err)]` on by default
```
Because AcceptError and all of its descendants fields are public,
excepting a descendant that contains a usize, it is impossible to reduce
the byte size of AcceptError without semver breakage.
If there's an active path we only want to send packets that must be sent
on a backup path on the backup path. All the other packets should go on
the active path, even if the active path is congestion blocked.
This commit makes there be fewer places where SendStream::execute_poll
is called directly. AsyncWrite implementations now go through poll_write,
and poll_write now goes through the write future. This means that
execute_poll is now only called directly from write and write_chunks.
Changes the implementation of `SendStream::stopped` such that the
returned future is static and no longer lifetime-bound onto a mutable
reference to the send stream.
This allows to use the stopped future with combinators or in a separate
task while still sending on the stream concurrently.
Internally, this is done changing the implementation of the stopped
notification to use a cloneable tokio::sync::Notify instead of storing
a single waker.
We need to make sure there's something ACK-eliciting. So there needs
to be a can_send.other. But the maybe_queue_probe function already
has this functionality in it. Just call it, even if the work that
function does has weird lines. For now keep it the same.
We maintain explicit send stream future implementation structs for
`Write`, `WriteAll`, `WriteChunk`, and `WriteAllChunks`. However, these
are private. We can significantly simplify this code by instead leaning
more directly on functionality such as async functions and
`std::future::poll_fn`.
The existing powerset check has problems:
- It takes too long.
- It failed to catch all the bugs fixed in the previous commit.
This commit fixes it as such:
- `--depth 3` is passed in which limits execution time.
- `--group-features` groups are removed which would have caught the bugs
fixed in the previous commit.
- `--clean-per-run` is removed as it's no longer necessary and slows it
down.
Experimentation indicates that a depth of 3 takes roughly a few minutes
to execute and catches bugs, whereas a depth of 4 takes roughly 40
minutes to run and does not catch any additional bugs.
TokenMemoryCache is a new implementation of TokenStore.
TokenMemoryCache is designed to store up to 2 tokens per server (this is
configurable) for up to 256 servers (this is also configurable), with a
LRU eviction policy. This is so that it works harmoniously with
rustls::ClientSessionMemoryCache, which by default stores resumption
state for up to 256 servers with a LRU eviction policy.
In order to perform GSO, an application needs to batch datagrams
together into a big buffer. As part of such a batch, the last datagram
is allowed to be less than the `segment_size` as that still allows the
kernel to unambigously segment the content into individual packets.
When GSO gets disabled at runtime due to lack of driver support,
applications need to segment such a prepared batch themselves into
individual `Transmit`s. Doing that may lead to situations in which a
`Transmit` is handed to `quinn-udp` which still has the original
`segment_size` set, yet its content is shorter than that.
Not all kernels like that. Specifically, it has been observed that
Android is particularly picky about these parameters.
We already sanitise the `segment_size` such that it is not set when it
is equal to the content length. To further increase the robustness of
`quinn-udp`, we extend this check to only set it when it is strictly
less than the content length.
Related: #2201
Related: #2145
Related: https://github.com/firezone/firezone/pull/8932