# HG changeset patch # User Sergey Kandaurov # Date 1453974584 -10800 # Node ID 62315953d7034c7e7501178a66298381616b7b38 # Parent 04eb968b098767cdfc0d51aea7be7ad0f3f01385 Tests: HTTP/2 test with empty request body. 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(301); + ->has_daemon('openssl')->plan(302); # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL @@ -1443,6 +1443,20 @@ is($frame->{headers}->{':status'}, '200' ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; is($frame->{headers}->{'x-body'}, 'TEST', 'request body in multiple frames'); +# request body with an empty DATA frame +# "zero size buf in output" alerts seen + +$sess = new_session(); +$sid = new_stream($sess, { body => '', headers => [ + { name => ':method', value => 'GET', mode => 2 }, + { name => ':scheme', value => 'http', mode => 2 }, + { name => ':path', value => '/proxy2/', mode => 2 }, + { name => ':authority', value => 'localhost', mode => 2 }]}); +$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); + +($frame) = grep { $_->{type} eq "HEADERS" } @$frames; +is($frame->{headers}->{':status'}, 200, 'request body - empty'); + # request body delayed in limit_req $sess = new_session();