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 <zizh...@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>'].

Reply via email to