comparison t/bytes.t @ 17:314242bda1c1

Correctly handle last ignored buffer again. If we ignore buffer marked as last_buf, make sure we pass out empty buffer marked as last_buf. The same problem was already fixed in rev. 48cdd1bfa48e, but only for optimized special case (last range and last buffer).
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 02 Feb 2009 19:54:12 +0300
parents d6f0d7a8d752
children
comparison
equal deleted inserted replaced
16:d1f754919b5d 17:314242bda1c1
15 ############################################################################### 15 ###############################################################################
16 16
17 select STDERR; $| = 1; 17 select STDERR; $| = 1;
18 select STDOUT; $| = 1; 18 select STDOUT; $| = 1;
19 19
20 my $t = Test::Nginx->new()->plan(24); 20 my $t = Test::Nginx->new()->plan(25);
21 21
22 $t->write_file_expand('nginx.conf', <<'EOF'); 22 $t->write_file_expand('nginx.conf', <<'EOF');
23 23
24 master_process off; 24 master_process off;
25 daemon off; 25 daemon off;
74 $t1 = http_get('/t1?bytes=-10'); 74 $t1 = http_get('/t1?bytes=-10');
75 like($t1, qr/200/, 'final bytes'); 75 like($t1, qr/200/, 'final bytes');
76 like($t1, qr/Content-Length: 10/, 'final bytes length'); 76 like($t1, qr/Content-Length: 10/, 'final bytes length');
77 like($t1, qr/^X099XXXXXX$/m, 'final bytes content'); 77 like($t1, qr/^X099XXXXXX$/m, 'final bytes content');
78 78
79 # standard error pages contain multiple buffers in one chain
80
81 like(http_get('/notfound?bytes=0-9'), qr/404/, 'not found');
82
79 # various range requests 83 # various range requests
80 84
81 $t1 = http_get_range('/t1?bytes=100-', 'Range: bytes=0-9'); 85 $t1 = http_get_range('/t1?bytes=100-', 'Range: bytes=0-9');
82 like($t1, qr/206/, 'first bytes - 206 partial reply'); 86 like($t1, qr/206/, 'first bytes - 206 partial reply');
83 like($t1, qr/Content-Length: 10/, 'first bytes - correct length'); 87 like($t1, qr/Content-Length: 10/, 'first bytes - correct length');