# HG changeset patch # User Sergey Kandaurov # Date 1580914924 -10800 # Node ID b02d0fd71638b5af380f164fa44514057ecef835 # Parent 2d747d967fc0118c73e521ef6e6b0278391c3823 Tests: added HTTP/2 test for HEADERS split on field boundary. diff --git a/h2.t b/h2.t --- a/h2.t +++ b/h2.t @@ -26,7 +26,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite charset gzip/) - ->plan(147); + ->plan(150); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -656,6 +656,28 @@ is($frame->{code}, 1, 'client header tim ($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames; ok($frame, 'client header timeout - PING'); +# partial request header frame received (no field split), +# the rest of frame is received after client header timeout + +$s = Test::Nginx::HTTP2->new(port(8087)); +$sid = $s->new_stream({ path => '/t2.html', split => [20], split_delay => 2.1 }); +$frames = $s->read(all => [{ type => 'RST_STREAM' }]); + +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.17.9'); + +($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; +ok($frame, 'client header timeout 2'); +is($frame->{code}, 1, 'client header timeout 2 - protocol error'); + +} + +$s->h2_ping('SEE-THIS'); +$frames = $s->read(all => [{ type => 'PING' }]); + +($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames; +ok($frame, 'client header timeout 2 - PING'); + # partial request body data frame received, the rest is after body timeout $s = Test::Nginx::HTTP2->new(port(8087));