quiche: add 100 continue support#14246
Conversation
Signed-off-by: Dan Zhang <danzh@google.com>
|
/assign @alyssawilk |
alyssawilk
left a comment
There was a problem hiding this comment.
Awesome - so exciting to see the corner cases in QUIC getting handled!
| response_decoder_->decodeHeaders( | ||
| quicHeadersToEnvoyHeaders<Http::ResponseHeaderMapImpl>(header_list), | ||
| /*end_stream=*/fin); | ||
| ENVOY_STREAM_LOG(debug, "Receive headers: {}.", *this, header_list.DebugString()); |
There was a problem hiding this comment.
Receive -> Received, here and below
| const uint64_t status = Http::Utility::getResponseStatus(*headers); | ||
| if (status >= 100 && status < 200) { | ||
| // These are Informational 1xx headers, not the actual response headers. | ||
| ENVOY_STREAM_LOG(debug, "Received informational response code: {}", *this, status); |
There was a problem hiding this comment.
is this redundant given full headers logged above?
| std::unique_ptr<Http::ResponseHeaderMapImpl> headers = | ||
| quicHeadersToEnvoyHeaders<Http::ResponseHeaderMapImpl>(header_list); | ||
| const uint64_t status = Http::Utility::getResponseStatus(*headers); | ||
| if (status >= 100 && status < 200) { |
Signed-off-by: Dan Zhang <danzh@google.com>
| std::unique_ptr<Http::ResponseHeaderMapImpl> headers = | ||
| quicHeadersToEnvoyHeaders<Http::ResponseHeaderMapImpl>(header_list); | ||
| const uint64_t status = Http::Utility::getResponseStatus(*headers); | ||
| if (Http::CodeUtility::is1xx(status)) { |
There was a problem hiding this comment.
So what happens with 1xx headers which are not 100-continue?
For non-QUIC we send them up via decodeHeaders.
There was a problem hiding this comment.
Oh, I didn't know that. Currently we drop these headers on the floor. Will fix it.
Question please: QUIC doens't support 101 response code: https://tools.ietf.org/html/draft-ietf-quic-http-32#section-4.3. What shall we do in that case?
There was a problem hiding this comment.
oh fair point. maybe treat it as invalid and fast-fail the response then?
There was a problem hiding this comment.
Re-wrote 1xx header handling logic here. PTAL!
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Dan Zhang <danzh@google.com>
|
Can someone reopen this PR? |
|
/retest |
|
Retrying Azure Pipelines: |
alyssawilk
left a comment
There was a problem hiding this comment.
LGTM modulo one test/TODO
| } | ||
|
|
||
| // Multiple 1xx before the request completes. | ||
| TEST_P(QuicHttpIntegrationTest, EnvoyProxyingEarlyMultiple1xx) { |
There was a problem hiding this comment.
Think it's worth a test of the reset for 101 here, or want to TODO it for later?
There was a problem hiding this comment.
It is already unit tested and will be covered by protocol integration test once HTTP3 is added into the test.
There was a problem hiding this comment.
Sorry, I misunderstood the test for non-100 case. 101 response status is indeed a HTTP3 specific case. Added an integration test here.
Signed-off-by: Dan Zhang <danzh@google.com>
Sorry for reverting my previous response, I added an e2e test intead. Mind taking another look? |
|
Can this PR be merged now? |
Signed-off-by: Dan Zhang danzh@google.com
Commit Message: Add 100 continue support to envoy_quic_client_stream. Fix some quic stream and stream decoder interaction issues.
Additional Description: issues fixed:
Following StreamDecoder callbacks shouldn't be called if decodeHeaders|Data|Traiers() causes stream is reset or connection close.
decodeHeaders|Data|Traiers() shouldn't be called if quic header/trailers are too large.
StreamCallback::onResetStream() shouldn't be called if end_stream is decoded.
Risk Level: low, not in use
Testing: Added more stream unit tests and an e2e test
Part of #2557