This is an automated email from the ASF dual-hosted git repository.

zwoop 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 fd8d4130b6 Fixed h2spec 6.4.3 test (#10584) (#10621)
fd8d4130b6 is described below

commit fd8d4130b6ce7eb01d69e000c38d3e4bf8b69a69
Author: Masakazu Kitajo <mas...@apache.org>
AuthorDate: Tue Oct 17 03:29:57 2023 +0900

    Fixed h2spec 6.4.3 test (#10584) (#10621)
    
    Should respond with FRAME_SIZE_ERROR when receiving reset frame of
    incorrect size before looking to see if the stream exists.
    
    (cherry picked from commit bb951e905e7844f304e6635a84acbd0734aed251)
    
     Conflicts:
            proxy/http2/Http2ConnectionState.cc
    
    Co-authored-by: Bryan Call <bc...@apache.org>
---
 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 dcfab9b674..675cdbc435 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -521,6 +521,13 @@ rcv_rst_stream_frame(Http2ConnectionState &cstate, 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 = cstate.find_stream(stream_id);
   if (stream == nullptr) {
     if (cstate.is_valid_streamid(stream_id)) {
@@ -531,13 +538,6 @@ rcv_rst_stream_frame(Http2ConnectionState &cstate, 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
   cstate.increment_received_rst_stream_frame_count();
   // Close this connection if its RST_STREAM frame count exceeds a limit

Reply via email to