You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2022/08/08 23:19:28 UTC

[trafficserver] 02/02: Correct error class of HTTP/2 malformed requests

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

masaori pushed a commit to branch asf-master-0809-4
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 8880f3c93887d5b154f951e99c35f92652c3a650
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Wed Apr 27 15:03:31 2022 +0900

    Correct error class of HTTP/2 malformed requests
---
 proxy/http2/Http2ConnectionState.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index e37025d70..b0e3a1cd9 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -139,7 +139,7 @@ Http2ConnectionState::rcv_data_frame(const Http2Frame &frame)
       return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_NONE);
     }
     if (!stream->payload_length_is_valid()) {
-      return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
+      return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
                         "recv data bad payload length");
     }
 
@@ -386,7 +386,7 @@ Http2ConnectionState::rcv_headers_frame(const Http2Frame &frame)
 
     // Check Content-Length & payload length when END_STREAM flag is true
     if (stream->recv_end_stream && !stream->payload_length_is_valid()) {
-      return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
+      return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
                         "recv data bad payload length");
     }
 
@@ -950,7 +950,7 @@ Http2ConnectionState::rcv_continuation_frame(const Http2Frame &frame)
 
     // Check Content-Length & payload length when END_STREAM flag is true
     if (stream->recv_end_stream && !stream->payload_length_is_valid()) {
-      return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
+      return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
                         "recv data bad payload length");
     }