This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.2.x by this push:
new b68467bccf [9.2.x] Terminate H2 connection by COMPRESSION_ERROR
(#11222) (#11263)
b68467bccf is described below
commit b68467bccfd9a28aeb5e564880e4a8f2993eff77
Author: Masaori Koshiba <[email protected]>
AuthorDate: Thu Apr 25 07:43:16 2024 +0900
[9.2.x] Terminate H2 connection by COMPRESSION_ERROR (#11222) (#11263)
* Terminate H2 connection by COMPRESSION_ERROR (#11222)
(cherry picked from commit 14d5b2ce401446a13b2fef4ab8dbc7cf890acf25)
Conflicts:
proxy/http2/Http2ConnectionState.cc
* Fix format
---
proxy/http2/Http2ConnectionState.cc | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/proxy/http2/Http2ConnectionState.cc
b/proxy/http2/Http2ConnectionState.cc
index 3abeeb32da..63d3ab9caa 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -260,6 +260,12 @@ rcv_headers_frame(Http2ConnectionState &cstate, const
Http2Frame &frame)
stream = cstate.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;
}
}
@@ -308,7 +314,7 @@ rcv_headers_frame(Http2ConnectionState &cstate, 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");
}