h3: earlier check for control and QPACK stream termination #1852
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
h3: earlier checks for control and QPACK stream termination
A peer can FIN or reset a control stream at any point during the stream
lifetime. While doing so is an error in HTTP/3, our handling before this change
was a bit odd.
Previously, depending on the sequencing, an unexpected termination of such a
stream could trigger an InvalidStreamState or StreamReset error during poll().
This would bubble up to the app, which is weird and unexpected because the
quiche h3 layer is supposed to deal with all the control stream details. While
both those errors contain a stream ID, the app isn't given any info that the ID
is a control stream.
While any subsequent call to poll() would then cause the stream_finished
detection to kick in and enforce the RFC rules to close the connection with
CloseCriticialStream, that's a bit late and clunky.
This change adds additional checks for the control and QPACK stream terminations
in order to make sure we close connections at the earliest time and prevent
useless errors getting bubbled up to apps.