Mercurial > hg > nginx-tests
comparison grpc.t @ 1623:3fe652bc9dae
Tests: introduced HTTP/2 frames buffering option in HTTP2 package.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 24 Nov 2020 01:23:01 +0000 |
parents | 5b3d33b5556c |
children | 81fd6615358e |
comparison
equal
deleted
inserted
replaced
1622:5b3d33b5556c | 1623:3fe652bc9dae |
---|---|
735 $c->h2_body('Hello world', { body_more => 1, | 735 $c->h2_body('Hello world', { body_more => 1, |
736 body_padding => $extra{body_padding} }); | 736 body_padding => $extra{body_padding} }); |
737 | 737 |
738 # stick trailers and subsequent frames for reproducibility | 738 # stick trailers and subsequent frames for reproducibility |
739 | 739 |
740 my $fld = $c->hpack('grpc-status', '0', mode => 2); | 740 $c->start_chain(); |
741 my $trailers = pack("x2CCCN", length($fld), 1, 5, $sid) . $fld; | 741 $c->new_stream({ headers => [ |
742 my $window = pack("xxCCCNN", 4, 8, 0, $sid, 42); | 742 { name => 'grpc-status', value => '0', mode => 2 } |
743 my $rst = pack("x2C2xNN", 4, 3, $sid, 0); | 743 ]}, $sid); |
744 my $cnl = pack("x2C2xNN", 4, 3, $sid, 8); | 744 $c->h2_window(42, $sid) if $uri eq '/Discard_WU'; |
745 | 745 $c->h2_rst($sid, 0) if $uri eq '/Discard_NE'; |
746 $trailers .= $window if $uri eq '/Discard_WU'; | 746 $c->h2_rst($sid, 0), $c->h2_rst($sid, 0), $c->h2_rst($sid, 0) |
747 $trailers .= $rst if $uri eq '/Discard_NE'; | 747 if $uri eq '/Discard_NE3'; |
748 $trailers .= ($rst x 3) if $uri eq '/Discard_NE3'; | 748 $c->h2_rst($sid, 8) if $uri eq '/Discard_CNL'; |
749 $trailers .= $cnl if $uri eq '/Discard_CNL'; | 749 $c->send_chain(); |
750 $c->raw_write($trailers); | |
751 | 750 |
752 return $s->read(all => [{ fin => 1 }], wait => 2) | 751 return $s->read(all => [{ fin => 1 }], wait => 2) |
753 if $uri eq '/Discard_WU' || $uri eq '/Discard_NE'; | 752 if $uri eq '/Discard_WU' || $uri eq '/Discard_NE'; |
754 return $s->read(all => [{ type => 'RST_STREAM' }]); | 753 return $s->read(all => [{ type => 'RST_STREAM' }]); |
755 }; | 754 }; |