-
-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proto: make PartialDecode API public #1865
Conversation
I'm not sure if |
What does this new trait add over the caller performing whatever validation they like themselves after decoding a header, as is already done with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced this ConnectionIdValidator
is the right abstraction. Given that we're dealing with parsing, it seems like that should be front and center, maybe something like:
trait ConnectionIdParser {
fn parse(&self, buf: &mut impl Buf) -> Result<ConnectionId, PacketDecodeError>;
}
(Feels like it could even be TryFrom
impl?)
Also in terms of commit history, I'd like to see one commit that makes all the existing API that you need public, and then a separate commit that adds any new stuff you need (with as little as possible duplication).
It looks like parsing the header needs the expected CID len as input. |
Thanks for review. I'm going to polish it based on your comments |
The idea of While in quinn, |
After further digging, I believe |
a53bc78
to
6a2a1cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking much better already.
6d4504a
to
b4e35b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly cosmetic issues, general direction looks good. Could you squash the constructor-unification commits down into the commits that introduce the new constructors?
211e7f0
to
d9190e7
Compare
433f69f
to
b16911c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
I ended up squashing and reordering these changes. I changed the commits to (a) first make the APIs public and then (b) add the |
It's totally fine to me . |
Currently `PlainHeader::decode` and `PartialDecoder::new` expect a `local_cid_len`, which means they cannot support variable length Connection ID format and make it less useful in various use cases, such as implementing a [QUIC-LB] confirming load balancer. [QUIC-LB]: https://www.ietf.org/archive/id/draft-ietf-quic-load-balancers-19.html
Context: #1860.
This PR did a bit more than just expose symbols to public, a trait
ConnectionIdValidator
was introduced, due to the fact that a QUIC Load balancer have to support different kind of Connection ID Schemes, per QUIC-LB-DRAFT Secion 4.1.Also some documents was added to suppress the clippy warning after those symbol being made public.