-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Improve control stream handling with HTTP/3 #26644
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
Improve control stream handling with HTTP/3 #26644
Conversation
jkotalik
commented
Oct 6, 2020
- Don't create outbound encoder and decoder streams as they aren't required now in the spec
- Correctly check if inbound streams have been created to throw exceptions
- Don't allocate a huge amount for encoding.
1c9ec42 to
f37541f
Compare
| // An endpoint MUST allow its peer to create an encoder stream and a | ||
| // decoder stream even if the connection's settings prevent their use. | ||
|
|
||
| while (_isClosed == 0) |
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.
Nit: I think it's better to check result.IsCompleted than _isClosed to avoid spinning if the two ever get out -of-sync (even if they're synchronized today).
|
|
||
| _haveReceivedSettingsFrame = true; | ||
| using var closedRegistration = _context.ConnectionContext.ConnectionClosed.Register(state => ((Http3ControlStream)state).OnStreamClosed(), this); | ||
| using var closedRegistration = _context.StreamContext.ConnectionClosed.Register(state => ((Http3ControlStream)state).OnStreamClosed(), 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.
What's thee difference between OnStreamClosed() and OnInputOrOutputCompleted() supposed to be? I see that OnStreamClosed() calls Abort(ConnectionAbortedException ex) which currently no-ops.
|
Merging to my other branch (not to master); need something in this PR for a further refactoring. |