mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-08 11:08:52 +08:00
Handle circular dependency
Handle the situation if a stream is told to depend on its descendant. This is what http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-5.3.3 says.
This commit is contained in:
@@ -492,14 +492,15 @@ int nghttp2_session_reprioritize_stream
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Ignore priority request if resultant tree has cycle */
|
||||
if(nghttp2_stream_dep_subtree_find(stream, dep_stream)) {
|
||||
DEBUGF(fprintf(stderr,
|
||||
"stream: future cycle detected, dep_stream(%p)=%d "
|
||||
"stream: cycle detected, dep_stream(%p)=%d "
|
||||
"stream(%p)=%d\n",
|
||||
dep_stream, dep_stream->stream_id,
|
||||
stream, stream->stream_id));
|
||||
return 0;
|
||||
|
||||
nghttp2_stream_dep_remove_subtree(dep_stream);
|
||||
nghttp2_stream_dep_make_root(dep_stream, &session->ob_pq);
|
||||
}
|
||||
|
||||
nghttp2_stream_dep_remove_subtree(stream);
|
||||
|
||||
Reference in New Issue
Block a user