# HG changeset patch # User Sergey Kandaurov # Date 1447943119 -10800 # Node ID eb257a102a9b1a65fd15f7098c9ab81b2daa88d5 # Parent 1f48ed26b49a7643c925b94d0c80926c52f952f8 Tests: turn typo into an actual RST_STREAM test with invalid path. diff --git a/h2.t b/h2.t --- a/h2.t +++ b/h2.t @@ -32,7 +32,7 @@ plan(skip_all => 'IO::Socket::SSL too ol my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) ->has(qw/limit_conn rewrite realip shmem/) - ->has_daemon('openssl')->plan(290); + ->has_daemon('openssl')->plan(291); # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL @@ -2859,10 +2859,18 @@ h2_ping($sess, 'SEE-THIS'); ($frame) = grep { $_->{type} eq "PING" } @$frames; is($frame->{value}, 'SEE-THIS', 'unknown frame type'); -# GOAWAY - force closing a connection by server +# client sent invalid :path header $sid = new_stream($sess, { path => 't1.html' }); -h2_read($sess, all => [{ sid => $sid, length => 2**16 - 1 }]); +$frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]); + +($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; +is($frame->{code}, 1, 'invalid path'); + +# GOAWAY - force closing a connection by server + +$sid = new_stream($sess); +h2_read($sess, all => [{ sid => $sid, fin => 1 }]); # graceful shutdown with stream waiting on HEADERS payload