This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push: new bb951e905e Fixed h2spec 6.4.3 test (#10584) bb951e905e is described below commit bb951e905e7844f304e6635a84acbd0734aed251 Author: Bryan Call <bc...@apache.org> AuthorDate: Wed Oct 11 07:28:11 2023 -0700 Fixed h2spec 6.4.3 test (#10584) Should respond with FRAME_SIZE_ERROR when receiving reset frame of incorrect size before looking to see if the stream exists. --- proxy/http2/Http2ConnectionState.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc index 9cff228851..398a520841 100644 --- a/proxy/http2/Http2ConnectionState.cc +++ b/proxy/http2/Http2ConnectionState.cc @@ -606,6 +606,13 @@ Http2ConnectionState::rcv_rst_stream_frame(const Http2Frame &frame) "reset access stream with invalid id"); } + // A RST_STREAM frame with a length other than 4 octets MUST be treated + // as a connection error (Section 5.4.1) of type FRAME_SIZE_ERROR. + if (frame.header().length != HTTP2_RST_STREAM_LEN) { + return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_FRAME_SIZE_ERROR, + "reset frame wrong length"); + } + Http2Stream *stream = this->find_stream(stream_id); if (stream == nullptr) { if (this->is_valid_streamid(stream_id)) { @@ -616,13 +623,6 @@ Http2ConnectionState::rcv_rst_stream_frame(const Http2Frame &frame) } } - // A RST_STREAM frame with a length other than 4 octets MUST be treated - // as a connection error (Section 5.4.1) of type FRAME_SIZE_ERROR. - if (frame.header().length != HTTP2_RST_STREAM_LEN) { - return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_FRAME_SIZE_ERROR, - "reset frame wrong length"); - } - // Update RST_STREAM frame count per minute this->increment_received_rst_stream_frame_count(); // Close this connection if its RST_STREAM frame count exceeds a limit