moonchen commented on code in PR #13351:
URL: https://github.com/apache/trafficserver/pull/13351#discussion_r3565272324
##########
src/proxy/http2/Http2ConnectionState.cc:
##########
@@ -1125,6 +1178,15 @@ Http2ConnectionState::rcv_continuation_frame(const
Http2Frame &frame)
"recv data bad payload length");
}
+ // Discard an interim (1xx) response from the
+ // origin and wait for the final response on this stream.
+ if (is_outbound_interim_response(stream)) {
Review Comment:
Same issue as the `rcv_headers_frame` copy of this block — an origin could
split the illegal 1xx across HEADERS+CONTINUATION and hit the same silent-drop
path here.
```suggestion
if (is_outbound_interim_response(stream)) {
if (stream->receive_end_stream) {
return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM,
Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
"1xx interim response must not set END_STREAM");
}
```
##########
src/proxy/http2/Http2ConnectionState.cc:
##########
@@ -510,6 +545,15 @@ Http2ConnectionState::rcv_headers_frame(const Http2Frame
&frame)
"recv data bad payload length");
}
+ // Discard an interim (1xx) response from the
+ // origin and wait for the final response on this stream.
+ if (is_outbound_interim_response(stream)) {
Review Comment:
RFC 9113 §8.1: "A HEADERS frame with the END_STREAM flag set that carries an
informational status code is malformed." §8.1.1 requires malformed messages be
"treated as a stream error (Section 5.4.2) of type PROTOCOL_ERROR".
If we don't catch this error here, `change_state()` would set the stream to
`CLOSED` before we get here. The real response has nowhere to go, and the
client hangs until timeout.
```suggestion
if (is_outbound_interim_response(stream)) {
if (stream->receive_end_stream) {
return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM,
Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
"1xx interim response must not set END_STREAM");
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]