Mercurial > hg > nginx-tests
comparison h2_fastcgi_request_buffering.t @ 945:d73bef563aea
Tests: speed up HTTP/2 tests.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 15 Jun 2016 13:27:56 +0300 |
parents | 6bb1f2ccd386 |
children | 4dc302d8e04f |
comparison
equal
deleted
inserted
replaced
944:235f796c2861 | 945:d73bef563aea |
---|---|
85 '56789many_eos', 'many - part 2'); | 85 '56789many_eos', 'many - part 2'); |
86 is($f->{http_end}(), 200, 'many - response'); | 86 is($f->{http_end}(), 200, 'many - response'); |
87 | 87 |
88 $f = get_body('/'); | 88 $f = get_body('/'); |
89 ok($f->{headers}, 'empty'); | 89 ok($f->{headers}, 'empty'); |
90 is($f->{upload}('', body_more => 1), '', 'empty - part'); | 90 is($f->{upload}('', body_more => 1, wait => 0.2), '', 'empty - part'); |
91 is($f->{upload}(''), '_eos', 'empty - part 2'); | 91 is($f->{upload}(''), '_eos', 'empty - part 2'); |
92 is($f->{http_end}(), 200, 'empty - response'); | 92 is($f->{http_end}(), 200, 'empty - response'); |
93 | 93 |
94 $f = get_body('/'); | 94 $f = get_body('/'); |
95 ok($f->{headers}, 'split'); | 95 ok($f->{headers}, 'split'); |
135 'cl many - part 2'); | 135 'cl many - part 2'); |
136 is($f->{http_end}(), 200, 'cl many - response'); | 136 is($f->{http_end}(), 200, 'cl many - response'); |
137 | 137 |
138 $f = get_body('/', 'content-length' => 0); | 138 $f = get_body('/', 'content-length' => 0); |
139 ok($f->{headers}, 'cl empty'); | 139 ok($f->{headers}, 'cl empty'); |
140 is($f->{upload}('', body_more => 1), '', 'cl empty - part'); | 140 is($f->{upload}('', body_more => 1, wait => 0.2), '', 'cl empty - part'); |
141 is($f->{upload}(''), '_eos', 'cl empty - part 2'); | 141 is($f->{upload}(''), '_eos', 'cl empty - part 2'); |
142 is($f->{http_end}(), 200, 'cl empty - response'); | 142 is($f->{http_end}(), 200, 'cl empty - response'); |
143 | 143 |
144 $f = get_body('/', 'content-length' => 10); | 144 $f = get_body('/', 'content-length' => 10); |
145 ok($f->{headers}, 'cl split'); | 145 ok($f->{headers}, 'cl split'); |
220 my $id = $h->{id}; | 220 my $id = $h->{id}; |
221 | 221 |
222 $f->{upload} = sub { | 222 $f->{upload} = sub { |
223 my ($body, %extra) = @_; | 223 my ($body, %extra) = @_; |
224 my $len = length($body); | 224 my $len = length($body); |
225 my $wait = $extra{wait}; | |
225 | 226 |
226 h2_body($sess, $body, { %extra }); | 227 h2_body($sess, $body, { %extra }); |
227 | 228 |
228 $body = ''; | 229 $body = ''; |
229 | 230 |
230 for (1 .. 10) { | 231 for (1 .. 10) { |
231 my $buf = raw_read($client, '', 1, \&log2i) | 232 my $buf = raw_read($client, '', 1, \&log2i, $wait) |
232 or return ''; | 233 or return ''; |
233 | 234 |
234 while (my $h = fastcgi_read_record(\$buf)) { | 235 while (my $h = fastcgi_read_record(\$buf)) { |
235 | 236 |
236 # skip everything unless stdin | 237 # skip everything unless stdin |