trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] branch 7.1.x updated: h2spec: handling PRIORITY frame that depend on itself
Date Tue, 09 May 2017 20:51:09 GMT
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/7.1.x by this push:
       new  625cc1b   h2spec: handling PRIORITY frame that depend on itself
625cc1b is described below

commit 625cc1bb495985825e1e1952cdc10a6ed3b81678
Author: Zizhong Zhang <zizhang@linkedin.com>
AuthorDate: Tue May 2 15:45:30 2017 -0700

    h2spec: handling PRIORITY frame that depend on itself
    
    (cherry picked from commit 0098932a0094c28034bf0743825491d141ee0b99)
---
 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 93d5ed7..8b26b12 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -270,7 +270,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_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
+      return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
                         "recv headers self dependency");
     }
 
@@ -387,6 +387,12 @@ rcv_priority_frame(Http2ConnectionState &cstate, const Http2Frame
&frame)
                       "priority parse error");
   }
 
+  //  A stream cannot depend on itself.  An endpoint MUST treat this as a stream error of
type PROTOCOL_ERROR.
+  if (stream_id == priority.stream_dependency) {
+    return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
+                      "PRIORITY frame depends on itself");
+  }
+
   DebugHttp2Stream(cstate.ua_session, stream_id, "PRIORITY - dep: %d, weight: %d, excl: %d,
tree size: %d",
                    priority.stream_dependency, priority.weight, priority.exclusive_flag,
cstate.dependency_tree->size());
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message