Breaking draft 21 updates - #394
Conversation
71be6e8 to
6d3b2a5
Compare
6ed63e9 to
d08e1b3
Compare
|
Switched capitalization to |
|
Nice one getting rid of |
|
My one request would be to consider moving all the code from |
d4cea56 to
088701f
Compare
Ensures correctness of application error codes without panics or adding new internal failure paths.
088701f to
de00d6e
Compare
63ff670 to
84482fb
Compare
| pub const MAX: VarInt = VarInt((1 << 62) - 1); | ||
|
|
||
| /// Construct a `VarInt` infallibly | ||
| pub const fn from_u32(x: u32) -> Self { |
There was a problem hiding this comment.
Why do we need this if we also have the From impl?
There was a problem hiding this comment.
A From impl can't be a const fn (yet?).
|
|
||
| /// A stream of QUIC streams initiated by a remote peer. | ||
| /// | ||
| /// Incoming streams are opened in the same order that the peer created them, but data can be |
There was a problem hiding this comment.
The former part of this sentence doesn't seem completely robust in case of datagram reordering, right?
There was a problem hiding this comment.
This is actually exactly correct as written, which is why it's worth calling out explicitly. Stream IDs are contiguous (modulo type bits), so if we see a discontinuity it's guaranteed that it's due to loss or reordering and the peer intended to open other streams first. This allows application protocols to assign special meaning to certain streams based on ordering without having to add tags, at the cost of requiring applications to take care not to do all stream processing in-order.
I'll expand it a bit for clarity.
fe88211 to
4cd887a
Compare
This wasn't working, and is not required by the spec.
The Closed state is entered - at the local application's request; - at the peer's request; - or when an error is detected. In the first case, the application is already aware of the closure. In the latter cases, connection loss is reported immediately. Hence, reporting connection loss when a close frame is received in the Closed state is always redundant.
APPLICATION_CLOSE and CONNECTION_CLOSE are handled similarly, so separate cases was gratuitously verbose.
This allows peers to enter the draining state immediately, which could reduce resource use.
This is a saner default, removing the need for a syscall for every bit of randomness generated.
4cd887a to
9dd4da4
Compare
|
Moved |
We only need the server config on incoming connections.
Based on #393. I'd like some feedback on the introduction of
Varintto public APIs. Alternative options include:This might catch people by surprise, especially if error codes from unvetted external sources are used.
Resultreturn values to currently infallible functionsThis is ugly.
This avoids the problems of the other two, but might still be an unpleasant surprise.
Drawbacks to the
Varintapproach include increased verbosity of infrequently-used APIs (connection close and stream reset/stop) and of inspecting application error codes in returned errors.