Mercurial > hg > nginx-tests
changeset 831:c384a2e53c1b
Tests: respect HTTP/2 header compression, related improvements.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 27 Jan 2016 19:56:04 +0300 |
parents | 3d12316e6f41 |
children | 04eb968b0987 |
files | h2.t |
diffstat | 1 files changed, 7 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/h2.t Wed Jan 27 18:44:18 2016 +0300 +++ b/h2.t Wed Jan 27 19:56:04 2016 +0300 @@ -32,7 +32,7 @@ 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(300); + ->has_daemon('openssl')->plan(301); # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL @@ -2051,26 +2051,23 @@ SKIP: { skip 'response header failed', 1 unless $frame; -ok(join('', @{$frame->{headers}->{'x-longheader'}}) eq 'x' x 2**15 x 3, +is(length join('', @{$frame->{headers}->{'x-longheader'}}), 98304, 'response header - headers'); } # response header block split and sent in parts -SKIP: { -skip 'broken by header compression', 1 unless $ENV{TEST_NGINX_UNSAFE}; - $sess = new_session(8092); $sid = new_stream($sess, { path => '/continuation?h=' . 'x' x 2**15 }); $frames = h2_read($sess, all => [{ sid => $sid, fin => 0x4 }]); @data = grep { $_->{type} =~ "HEADERS|CONTINUATION" } @$frames; -$lengths = join ' ', map { $_->{length} } @data; -like($lengths, qr/16384 16384 16384 16384 16384 16384 \d+/, - 'response header split - parts'); - -} +($lengths) = sort { $b <=> $a } map { $_->{length} } @data; +cmp_ok($lengths, '<=', 16384, 'response header split - max size'); + +is(length join('', @{@$frames[-1]->{headers}->{'x-longheader'}}), 98304, + 'response header split - headers'); }