changeset 833:62315953d703

Tests: HTTP/2 test with empty request body.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 28 Jan 2016 12:49:44 +0300
parents 04eb968b0987
children 37747a4ff78e
files h2.t
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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();