changeset 871:f693b0aea20f

Tests: added HTTP/2 test for request body sent in separate frames.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 16 Mar 2016 18:19:33 +0300
parents 56994b4ce142
children a07734ecb988
files h2.t
diffstat 1 files changed, 15 insertions(+), 2 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(318);
+	->has_daemon('openssl')->plan(319);
 
 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL
 
@@ -1522,7 +1522,7 @@ is(read_body_file($frame->{headers}->{'x
 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
 is($frame->{headers}->{':status'}, '200', 'request body with padding - next');
 
-# request body sent in multiple DATA frames (uses proxied response)
+# request body sent in multiple DATA frames in a single packet
 
 $sess = new_session();
 $sid = new_stream($sess, { path => '/proxy2/t2.html', body_more => 1 });
@@ -1533,6 +1533,19 @@ h2_body($sess, 'TEST', { body_split => [
 is(read_body_file($frame->{headers}->{'x-body-file'}), 'TEST',
 	'request body in multiple frames');
 
+# request body sent in multiple DATA frames, each in its own packet
+
+$sess = new_session();
+$sid = new_stream($sess, { path => '/proxy2/t2.html', body_more => 1 });
+h2_body($sess, 'TEST', { body_more => 1 });
+select undef, undef, undef, 0.1;
+h2_body($sess, 'MOREDATA');
+$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
+
+($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
+is(read_body_file($frame->{headers}->{'x-body-file'}), 'TESTMOREDATA',
+	'request body in multiple frames separately');
+
 # request body with an empty DATA frame
 # "zero size buf in output" alerts seen