-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
implement HTTP/3 unidirectional stream hijacking #3389
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
f3465af
to
91409ba
Compare
91409ba
to
8a44d2e
Compare
6dcd185
to
1e53956
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 PR is not correct. Unidirectional streams are marked by their stream type, not by a frame.
http3/client.go
Outdated
@@ -44,6 +44,7 @@ type roundTripperOpts struct { | |||
MaxHeaderBytes int64 | |||
AdditionalSettings map[uint64]uint64 | |||
StreamHijacker func(FrameType, quic.Connection, quic.Stream) (hijacked bool, err error) | |||
UniStreamHijacker func(FrameType, quic.Connection, quic.ReceiveStream) (hijacked bool, err error) |
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 not a frame type, it's a stream type. We should have a separate type for this.
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.
Yes, I was misunderstanding. I fixed it.
027248f
to
f1a3510
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.
Thank you for working on this!
http3/client.go
Outdated
str.CancelRead(quic.StreamErrorCode(errorStreamCreationError)) | ||
return | ||
} | ||
f, err := parseNextFrame(str, nil) |
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.
You don't need to move this block.
http3/client.go
Outdated
@@ -44,6 +44,7 @@ type roundTripperOpts struct { | |||
MaxHeaderBytes int64 | |||
AdditionalSettings map[uint64]uint64 | |||
StreamHijacker func(FrameType, quic.Connection, quic.Stream) (hijacked bool, err error) | |||
UniStreamHijacker func(StreamType, quic.Connection, quic.ReceiveStream) (hijacked bool, err error) |
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.
Does this really need an error return value?
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 think it doesn't.
A unit test for this would also be very nice to have in this PR :) |
Codecov Report
@@ Coverage Diff @@
## master #3389 +/- ##
==========================================
+ Coverage 85.39% 85.40% +0.01%
==========================================
Files 135 135
Lines 9906 9911 +5
==========================================
+ Hits 8459 8464 +5
Misses 1065 1065
Partials 382 382
Continue to review full report at Codecov.
|
5dfd1d4
to
7413e41
Compare
7413e41
to
47a29d3
Compare
Thank you for your review! |
Fixed name consistency. Co-authored-by: Marten Seemann <martenseemann@gmail.com>
Thank you for your suggestions. I fixed words inconsistency at cb8951a. |
* implement HTTP/3 unistream hijacking * Apply suggestions from code review Fixed name consistency. Co-authored-by: Marten Seemann <martenseemann@gmail.com> * rename unistream to unidirectional stream Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* implement HTTP/3 unistream hijacking * Apply suggestions from code review Fixed name consistency. Co-authored-by: Marten Seemann <martenseemann@gmail.com> * rename unistream to unidirectional stream Co-authored-by: Marten Seemann <martenseemann@gmail.com>
Additional implementation of #3362. To support for hijacking unidirectional streams.