This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch 10.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 6c9143f51de90740e0ec1c7fe352e5c482b08614 Author: Masaori Koshiba <masa...@apache.org> AuthorDate: Fri Apr 12 08:16:09 2024 +0900 Terminate H2 connection by COMPRESSION_ERROR (#11222) (cherry picked from commit 14d5b2ce401446a13b2fef4ab8dbc7cf890acf25) --- src/proxy/http2/Http2ConnectionState.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/proxy/http2/Http2ConnectionState.cc b/src/proxy/http2/Http2ConnectionState.cc index 9bb38b097a..c15102e3c5 100644 --- a/src/proxy/http2/Http2ConnectionState.cc +++ b/src/proxy/http2/Http2ConnectionState.cc @@ -320,6 +320,13 @@ Http2ConnectionState::rcv_headers_frame(const Http2Frame &frame) stream = this->create_stream(stream_id, error); new_stream = true; if (!stream) { + // Terminate the connection with COMPRESSION_ERROR because we don't decompress the field block in this HEADERS frame. + // TODO: try to decompress to keep HPACK Dynamic Table in sync. + if (error.cls == Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM) { + return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_COMPRESSION_ERROR, + error.msg); + } + return error; } } @@ -377,7 +384,7 @@ Http2ConnectionState::rcv_headers_frame(const Http2Frame &frame) } // Protocol error if the stream depends on itself if (stream_id == params.priority.stream_dependency) { - return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR, + return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_COMPRESSION_ERROR, "recv headers self dependency"); }