# HG changeset patch # User Sergey Kandaurov # Date 1568038560 -10800 # Node ID c4c2275cda5548dd36acf4ba6ed9f3eab7949326 # Parent 76090a5da00b1aad2701bd5a82a1578affae0ea9 Tests: expect GOAWAY on HTTP/2 frames with dependency on itself. diff --git a/h2_priority.t b/h2_priority.t --- a/h2_priority.t +++ b/h2_priority.t @@ -206,18 +206,24 @@ is($sids, "$sid $sid2", 'dependency - PR # 5.3.1. Stream Dependencies # A stream cannot depend on itself. An endpoint MUST treat this as a # stream error of type PROTOCOL_ERROR. +# Instead, we respond with a connection error of type PROTOCOL_ERROR. + +TODO: { +local $TODO = 'not yet'; $s = Test::Nginx::HTTP2->new(); $sid = $s->new_stream(); $s->read(all => [{ sid => $sid, fin => 1 }]); $s->h2_priority(0, $sid, $sid); -$frames = $s->read(all => [{ type => 'RST_STREAM' }]); +$frames = $s->read(all => [{ type => 'GOAWAY' }]); -my ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; -is($frame->{sid}, $sid, 'dependency - PRIORITY self - RST_STREAM'); +my ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; +is($frame->{last_sid}, $sid, 'dependency - PRIORITY self - GOAWAY'); is($frame->{code}, 1, 'dependency - PRIORITY self - PROTOCOL_ERROR'); +} + # HEADERS PRIORITY flag, reprioritize prior PRIORITY frame records $s = Test::Nginx::HTTP2->new(); @@ -272,14 +278,19 @@ is($sids, "$sid $sid2", 'dependency - HE # HEADERS - self dependency +TODO: { +local $TODO = 'not yet'; + $s = Test::Nginx::HTTP2->new(); $sid = $s->new_stream({ dep => 1 }); -$frames = $s->read(all => [{ type => 'RST_STREAM' }]); +$frames = $s->read(all => [{ type => 'GOAWAY' }]); -($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; -is($frame->{sid}, $sid, 'dependency - HEADERS self - RST_STREAM'); +my ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; +is($frame->{last_sid}, 0, 'dependency - HEADERS self - GOAWAY'); is($frame->{code}, 1, 'dependency - HEADERS self - PROTOCOL_ERROR'); +} + # PRIORITY frame, weighted dependencies $s = Test::Nginx::HTTP2->new(); @@ -391,7 +402,7 @@ for (1 .. 40) { { sid => $sid3, fin => 1 }, ]); -($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == $sid } @$frames; +my ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == $sid } @$frames; is($frame->{length}, 81, 'removed dependency - first stream'); ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == $sid3 } @$frames;