Mercurial > hg > nginx-tests
changeset 1499:c9d7e2a26b2d
Tests: HTTP/2 request body preread of DATA without END_STREAM.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 20 Aug 2019 15:39:03 +0300 |
parents | 63a74974a0e9 |
children | 44ce08f5259f |
files | h2_request_body_preread.t |
diffstat | 1 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/h2_request_body_preread.t Mon Aug 19 17:17:42 2019 +0300 +++ b/h2_request_body_preread.t Tue Aug 20 15:39:03 2019 +0300 @@ -89,7 +89,7 @@ EOF $t->write_file('t', ''); -$t->run()->plan(8); +$t->run()->plan(9); ############################################################################### @@ -129,6 +129,21 @@ ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; is($frame->{headers}->{'x-body'}, 'TEST', 'within preread limited'); +# processing request body without END_STREAM in preread + +$sid = $s->new_stream({ path => '/req', body_more => 1, continuation => 1 }); +$s->h2_continue($sid, + { headers => [{ name => 'content-length', value => '8' }]}); + +$s->h2_body('SEE', { body_more => 1 }); +$s->read(all => [{ type => 'WINDOW_UPDATE' }]); + +$s->h2_body('-THIS'); +$frames = $s->read(all => [{ sid => $sid, fin => 1 }]); + +($frame) = grep { $_->{type} eq "HEADERS" } @$frames; +is($frame->{headers}->{'x-body'}, 'SEE-THIS', 'within preread limited - more'); + # beyond preread size - limited $s = Test::Nginx::HTTP2->new();