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
[WebTransport] Add support for multiples capsules #30982
Conversation
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.
Defer to @vasilvv's review for details, just minor comments.
Represents the Capsule concept defined in | ||
https://ietf-wg-masque.github.io/draft-ietf-masque-h3-datagram/draft-ietf-masque-h3-datagram.html#name-capsules. | ||
""" | ||
def __init__(self, type: int, data: bytes) -> None: |
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.
Why can't this be CapsuleType?
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.
Because we may have a capsule with an unknown type.
# https://www.ietf.org/archive/id/draft-ietf-masque-h3-datagram-03.html. | ||
DATAGRAM = 0xff37a0 | ||
REGISTER_DATAGRAM_CONTEXT = 0xff37a1 | ||
REGISTER_DATAGRAM_NO_CONTEXT = 0xff37a2 |
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.
As a note, h3-datagram-draft04 actually requires us to receive at least REGISTER_DATAGRAM_NO_CONTEXT (we should also support DATAGRAM).
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.
we should also support DATAGRAM
For WebTransport over HTTP/3 we use https://ietf-wg-masque.github.io/draft-ietf-masque-h3-datagram/draft-ietf-masque-h3-datagram.html#name-http-3-datagram-format rather than https://ietf-wg-masque.github.io/draft-ietf-masque-h3-datagram/draft-ietf-masque-h3-datagram.html#name-the-datagram-capsule, right?
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.
Chromium accepts both, though I don't believe we send the DATAGRAM capsule currently.
self._type = self._buffer.pull_uint_var() | ||
if self._length is None: | ||
self._length = self._buffer.pull_uint_var() | ||
if self._buffer.capacity - self._buffer.tell() < self._length: |
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.
Is this line actually required? I'd assume the line below would just throw if that condition is not met.
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.
Done.
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.
Oops, This is needed as the exception can be rethrown in the except block.
9fb53e6
to
cfd2b8d
Compare
@vasilvv can you take a look again? |
f463377
to
60f9d62
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, thank you!
Co-authored-by: bashi <bashi@chromium.org>
7e7bd3b
to
51546cf
Compare
Co-authored-by: bashi <bashi@chromium.org>
Add support for multiple capsules on the session stream.