comparison proxy-chunked.t @ 94:9ab3762332b9

Tests: chunked tests for unbuffered and inmemory proxy. Note that while these two modes currently use the same filter function they are quite different. Only one continuous buffer (u->buffer) used for subrequest_in_memory and this means that chunk-data should be concatenated somehow (memmove?).
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 10 May 2009 03:53:20 +0400
parents 1bf5eca1c4a9
children 1c0ec30614c6
comparison
equal deleted inserted replaced
90:1d3c82227a05 94:9ab3762332b9
11 ############################################################################### 11 ###############################################################################
12 12
13 use warnings; 13 use warnings;
14 use strict; 14 use strict;
15 15
16 use Test::More tests => 1; 16 use Test::More tests => 3;
17 17
18 use IO::Select; 18 use IO::Select;
19 19
20 BEGIN { use FindBin; chdir($FindBin::Bin); } 20 BEGIN { use FindBin; chdir($FindBin::Bin); }
21 21
51 51
52 location / { 52 location / {
53 proxy_pass http://127.0.0.1:8081; 53 proxy_pass http://127.0.0.1:8081;
54 proxy_read_timeout 1s; 54 proxy_read_timeout 1s;
55 } 55 }
56 location /nobuffering {
57 proxy_pass http://127.0.0.1:8081;
58 proxy_read_timeout 1s;
59 proxy_buffering off;
60 }
61 location /inmemory.html {
62 ssi on;
63 }
56 } 64 }
57 } 65 }
58 66
59 EOF 67 EOF
68
69 $t->write_file('inmemory.html',
70 '<!--#include virtual="/" set="one" --><!--#echo var="one" -->');
60 71
61 $t->run_daemon(\&http_chunked_daemon); 72 $t->run_daemon(\&http_chunked_daemon);
62 $t->run(); 73 $t->run();
63 74
64 ############################################################################### 75 ###############################################################################
65 76
66 { 77 {
67 local $TODO = 'not yet'; 78 local $TODO = 'not yet';
68 79
69 like(http_get('/'), qr/\x0d\x0aSEE-THIS$/s, 'chunked'); 80 like(http_get('/'), qr/\x0d\x0aSEE-THIS$/s, 'chunked');
81 like(http_get('/nobuffering'), qr/\x0d\x0aSEE-THIS$/s, 'chunked nobuffering');
82 like(http_get('/inmemory.html'), qr/\x0d\x0aSEE-THIS$/s, 'chunked inmemory');
70 } 83 }
71 84
72 ############################################################################### 85 ###############################################################################
73 86
74 sub http_chunked_daemon { 87 sub http_chunked_daemon {