# HG changeset patch # User Sergey Kandaurov # Date 1445980304 -10800 # Node ID 4db976a91540379bd0efc1030f35f7d98e33357e # Parent 6406eee6366cefa2c515ab5c9b5353828fc0a042 Tests: HTTP/2 tests for client-initiated PUSH_PROMISE. 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(247); + ->has_daemon('openssl')->plan(249); # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL @@ -393,6 +393,17 @@ is($frame->{code}, 1, 'GOAWAY invalid st } +# client-initiated PUSH_PROMISE, just to ensure nothing went wrong +# N.B. other implementation returns zero code, which is not anyhow regulated + +$sess = new_session(); +raw_write($sess->{socket}, pack("x2C2xN", 4, 0x5, 1)); +$frames = h2_read($sess, all => [{ type => "GOAWAY" }]); + +($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; +ok($frame, 'client-initiated PUSH_PROMISE - GOAWAY frame'); +is($frame->{code}, 1, 'client-initiated PUSH_PROMISE - GOAWAY PROTOCOL_ERROR'); + # GET $sess = new_session();