File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -348,6 +348,10 @@ def insert_stream(self,
348348
349349 if not depends_on :
350350 depends_on = 0
351+ elif depends_on == stream_id :
352+ raise PriorityLoop (
353+ "Stream %d must not depend on itself." % stream_id
354+ )
351355
352356 if exclusive :
353357 parent_stream = self ._get_or_insert_parent (depends_on )
@@ -389,6 +393,11 @@ def reprioritize(self,
389393 # own dependents. Then, we remove this stream from its current parent
390394 # and move it to its new parent, taking its children with it.
391395 if depends_on :
396+ if depends_on == stream_id :
397+ raise PriorityLoop (
398+ "Stream %d must not depend on itself" % stream_id
399+ )
400+
392401 new_parent = self ._get_or_insert_parent (depends_on )
393402 cycle = _stream_cycle (new_parent , current_stream )
394403 else :
You can’t perform that action at this time.
0 commit comments