comparison h2.t @ 860:cba4b1bccfd1

Tests: HTTP/2 test with empty request body delayed in limit_req.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 26 Feb 2016 17:59:04 +0300
parents 63babcdd08db
children 89898b20f258
comparison
equal deleted inserted replaced
859:63babcdd08db 860:cba4b1bccfd1
30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); }; 30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); };
31 plan(skip_all => 'IO::Socket::SSL too old') if $@; 31 plan(skip_all => 'IO::Socket::SSL too old') if $@;
32 32
33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) 33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/)
34 ->has(qw/limit_conn rewrite realip shmem/) 34 ->has(qw/limit_conn rewrite realip shmem/)
35 ->has_daemon('openssl')->plan(317); 35 ->has_daemon('openssl')->plan(318);
36 36
37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL 37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL
38 38
39 $t->todo_alerts(); 39 $t->todo_alerts();
40 40
1582 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); 1582 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
1583 1583
1584 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 1584 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
1585 is(read_body_file($frame->{headers}->{'x-body-file'}), 'TEST', 1585 is(read_body_file($frame->{headers}->{'x-body-file'}), 'TEST',
1586 'request body - limit req'); 1586 'request body - limit req');
1587
1588 # request body delayed in limit_req - with an empty DATA frame
1589
1590 $sess = new_session();
1591 $sid = new_stream($sess, { path => '/proxy_limit_req/', body_more => 1 });
1592 h2_body($sess, '');
1593 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
1594
1595 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
1596 is($frame->{headers}->{':status'}, 200, 'request body - limit req - empty');
1587 1597
1588 # predict send windows 1598 # predict send windows
1589 1599
1590 $sid = new_stream($sess); 1600 $sid = new_stream($sess);
1591 my ($maxwin) = sort {$a <=> $b} $sess->{streams}{$sid}, $sess->{conn_window}; 1601 my ($maxwin) = sort {$a <=> $b} $sess->{streams}{$sid}, $sess->{conn_window};