This change introduces a second `RangeSet` type which is based on a
linear array/vector instead of a tree. For the purpose of tracking
ACK ranges we usually should not have a big number of disjoint ranges,
since those would only occur with severe fragmentation. Therefore the
main benefit of a tree which is able to find ranges in the middle is
rarely used.
The array-based RangeSet provides 2 benefits:
- There exists an inline representation, which avoids the need of heap
allocating ACK ranges for `SentFrames` for small ranges.
- Iterating over ranges should usually be faster since there is only
a single cache-friendly contiguous range.
Performance differences:
With the `BTreeMap` based `RangeSet`:
```
Sent 1073741824 bytes on 1 streams in 1.90s (538.89 MiB/s)
```
With the `TinyVec` based `RangeSet`:
```
Sent 1073741824 bytes on 1 streams in 1.78s (574.73 MiB/s)
```
A crypto session cannot return 1-RTT keys before handshaking is finished.
Currently, rustls contains unwrap() calls to deal with this, but hoisting
out the unwrap to the `Connection` level here seems more sensible.
We can adjust the call into rustls once we update rustls for other reasons.
This change adds additional config arguments to the echo test.
We are then using those arguments to run a higher number of
streams while utilizing low flow control windows to test flow
control updates.
This pollutes the log a lot and doesn't help debugging.
All cases where a packet is not authenticated should already be
logged in different places, so just remove this.
When the server's first flight is interrupted by anti-amplification
and the client's second flight is lost, the client has no
ack-eliciting packets in flight but will not be able to proceed until
an anti-amplification deadlock prevention probe is sent.
Previously rustc would fail with
error: reached the type-length limit while instantiating
`<std::vec::IntoIter<Peer> as std...rs:216:58: 220:6 keylog:&bool]]>`
Creating a `ClientConfig` can on some platforms take an excessive amount
of time, likely due to rustls scanning the systems cert store.
This slows down all functions which make use of `quinn::Endpoint::builder()`,
even if the client config is known upfront and shared between mutliple connections.
In some tests I noticed an extra connection establishment time of 1s for
creating a client.
This changes will create the `ClientConfig` only if the Endpoint is built
when the `ClientConfig` hasn't been set by the application.
Server side code still suffers from the issue, since `ClientConfig`s there are not
known. However it might be less impacting, since a second of startup time for
a server matters less than for a client.