Mercurial > hg > nginx-tests
annotate proxy_request_buffering.t @ 1990:85d88cd5091c
Tests: SSI include stub tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:42:55 +0300 |
parents | 882267679006 |
children |
rev | line source |
---|---|
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
2 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
3 # (C) Maxim Dounin |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
4 # (C) Sergey Kandaurov |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
5 # (C) Nginx, Inc. |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
6 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
7 # Tests for unbuffered request body. |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
8 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
9 ############################################################################### |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
10 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
11 use warnings; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
12 use strict; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
13 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
14 use Test::More; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
15 use Socket qw/ CRLF /; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
16 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
17 BEGIN { use FindBin; chdir($FindBin::Bin); } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
18 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
19 use lib 'lib'; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
20 use Test::Nginx; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
21 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
22 ############################################################################### |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
23 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
24 select STDERR; $| = 1; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
25 select STDOUT; $| = 1; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
26 |
568
907e89fba9c3
Tests: removed TODO and try_run() checks for legacy versions.
Sergey Kandaurov <pluknet@nginx.com>
parents:
545
diff
changeset
|
27 my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(18); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
28 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
29 $t->write_file_expand('nginx.conf', <<'EOF'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
30 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
31 %%TEST_GLOBALS%% |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
32 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
33 daemon off; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
34 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
35 events { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
36 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
37 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
38 http { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
39 %%TEST_GLOBALS_HTTP%% |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
40 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
41 server { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
42 listen 127.0.0.1:8080; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
43 server_name localhost; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
44 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
45 client_header_buffer_size 1k; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
46 proxy_request_buffering off; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
47 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
48 location / { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
49 client_body_buffer_size 2k; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
50 add_header X-Body "$request_body"; |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
51 proxy_pass http://127.0.0.1:8081; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
52 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
53 location /small { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
54 client_body_in_file_only on; |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
55 proxy_pass http://127.0.0.1:8080/; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
56 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
57 location /single { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
58 client_body_in_single_buffer on; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
59 add_header X-Body "$request_body"; |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
60 proxy_pass http://127.0.0.1:8081; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
61 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
62 location /discard { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
63 return 200 "TEST\n"; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
64 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
65 location /preread { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
66 proxy_pass http://127.0.0.1:8082/; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
67 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
68 location /error_page { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
69 proxy_pass http://127.0.0.1:8081/404; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
70 error_page 404 /404; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
71 proxy_intercept_errors on; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
72 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
73 location /404 { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
74 return 200 "$request_body\n"; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
75 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
76 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
77 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
78 server { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
79 listen 127.0.0.1:8081; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
80 server_name localhost; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
81 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
82 location / { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
83 proxy_pass http://127.0.0.1:8080/discard; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
84 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
85 location /404 { } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
86 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
87 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
88 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
89 EOF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
90 |
568
907e89fba9c3
Tests: removed TODO and try_run() checks for legacy versions.
Sergey Kandaurov <pluknet@nginx.com>
parents:
545
diff
changeset
|
91 $t->run(); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
92 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
93 ############################################################################### |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
94 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
95 unlike(http_get('/'), qr/X-Body:/ms, 'no body'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
96 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
97 like(http_get_body('/', '0123456789'), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
98 qr/X-Body: 0123456789\x0d?$/ms, 'body'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
99 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
100 like(http_get_body('/', '0123456789' x 128), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
101 qr/X-Body: (0123456789){128}\x0d?$/ms, 'body in two buffers'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
102 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
103 like(http_get_body('/single', '0123456789' x 128), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
104 qr/X-Body: (0123456789){128}\x0d?$/ms, 'body in single buffer'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
105 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
106 like(http_get_body('/error_page', '0123456789'), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
107 qr/^0123456789$/m, 'body in error page'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
108 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
109 # pipelined requests |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
110 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
111 like(http_get_body('/', '0123456789', '0123456789' x 128, '0123456789' x 512, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
112 'foobar'), qr/X-Body: foobar\x0d?$/ms, 'body pipelined'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
113 like(http_get_body('/', '0123456789' x 128, '0123456789' x 512, '0123456789', |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
114 'foobar'), qr/X-Body: foobar\x0d?$/ms, 'body pipelined 2'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
115 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
116 like(http_get_body('/discard', '0123456789', '0123456789' x 128, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
117 '0123456789' x 512, 'foobar'), qr/(TEST.*){4}/ms, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
118 'body discard'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
119 like(http_get_body('/discard', '0123456789' x 128, '0123456789' x 512, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
120 '0123456789', 'foobar'), qr/(TEST.*){4}/ms, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
121 'body discard 2'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
122 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
123 # proxy with file only is disabled in unbuffered mode |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
124 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
125 like(http_get_body('/small', '0123456789'), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
126 qr/X-Body: 0123456789\x0d?$/ms, 'small body in file only'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
127 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
128 # interactive tests |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
129 |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
130 my $s = get_body('/preread', port(8082), 10); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
131 ok($s, 'no preread'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
132 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
133 SKIP: { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
134 skip 'no preread failed', 3 unless $s; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
135 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
136 is($s->{upload}('01234'), '01234', 'no preread - body part'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
137 is($s->{upload}('56789'), '56789', 'no preread - body part 2'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
138 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
139 like($s->{http_end}(), qr/200 OK/, 'no preread - response'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
140 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
141 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
142 |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
143 $s = get_body('/preread', port(8082), 10, '01234'); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
144 ok($s, 'preread'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
145 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
146 SKIP: { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
147 skip 'preread failed', 3 unless $s; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
148 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
149 is($s->{preread}, '01234', 'preread - preread'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
150 is($s->{upload}('56789'), '56789', 'preread - body'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
151 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
152 like($s->{http_end}(), qr/200 OK/, 'preread - response'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
153 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
154 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
155 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
156 ############################################################################### |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
157 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
158 sub http_get_body { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
159 my $uri = shift; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
160 my $last = pop; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
161 return http( join '', (map { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
162 my $body = $_; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
163 "GET $uri HTTP/1.1" . CRLF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
164 . "Host: localhost" . CRLF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
165 . "Content-Length: " . (length $body) . CRLF . CRLF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
166 . $body |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
167 } @_), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
168 "GET $uri HTTP/1.1" . CRLF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
169 . "Host: localhost" . CRLF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
170 . "Connection: close" . CRLF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
171 . "Content-Length: " . (length $last) . CRLF . CRLF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
172 . $last |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
173 ); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
174 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
175 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
176 sub get_body { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
177 my ($url, $port, $length, $body) = @_; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
178 my ($server, $client, $s); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
179 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
180 $server = IO::Socket::INET->new( |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
181 Proto => 'tcp', |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
182 LocalHost => '127.0.0.1', |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
183 LocalPort => $port, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
184 Listen => 5, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
185 Reuse => 1 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
186 ) |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
187 or die "Can't create listening socket: $!\n"; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
188 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
189 my $r = <<EOF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
190 GET $url HTTP/1.1 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
191 Host: localhost |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
192 Connection: close |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
193 Content-Length: $length |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
194 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
195 EOF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
196 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
197 if (defined $body) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
198 $r .= $body; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
199 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
200 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
201 $s = http($r, start => 1); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
202 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
203 eval { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
204 local $SIG{ALRM} = sub { die "timeout\n" }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
205 local $SIG{PIPE} = sub { die "sigpipe\n" }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
206 alarm(5); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
207 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
208 $client = $server->accept(); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
209 |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
210 log2c("(new connection $client)"); |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
211 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
212 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
213 }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
214 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
215 if ($@) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
216 log_in("died: $@"); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
217 return undef; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
218 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
219 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
220 $client->sysread(my $buf, 1024); |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
221 log2i($buf); |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
222 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
223 $buf =~ s/.*?\x0d\x0a?\x0d\x0a?(.*)/$1/ms; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
224 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
225 my $f = { preread => $buf }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
226 $f->{upload} = sub { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
227 my $buf = shift; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
228 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
229 eval { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
230 local $SIG{ALRM} = sub { die "timeout\n" }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
231 local $SIG{PIPE} = sub { die "sigpipe\n" }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
232 alarm(5); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
233 |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
234 log_out($buf); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
235 $s->write($buf); |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
236 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
237 $client->sysread($buf, 1024); |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
238 log2i($buf); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
239 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
240 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
241 }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
242 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
243 if ($@) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
244 log_in("died: $@"); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
245 return undef; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
246 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
247 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
248 return $buf; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
249 }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
250 $f->{http_end} = sub { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
251 my $buf = ''; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
252 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
253 $client->write(<<EOF); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
254 HTTP/1.1 200 OK |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
255 Connection: close |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
256 X-Port: $port |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
257 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
258 OK |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
259 EOF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
260 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
261 $client->close; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
262 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
263 eval { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
264 local $SIG{ALRM} = sub { die "timeout\n" }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
265 local $SIG{PIPE} = sub { die "sigpipe\n" }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
266 alarm(5); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
267 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
268 $s->sysread($buf, 1024); |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
269 log_in($buf); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
270 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
271 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
272 }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
273 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
274 if ($@) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
275 log_in("died: $@"); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
276 return undef; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
277 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
278 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
279 return $buf; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
280 }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
281 return $f; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
282 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
283 |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
284 sub log2i { Test::Nginx::log_core('|| <<', @_); } |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
285 sub log2o { Test::Nginx::log_core('|| >>', @_); } |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
286 sub log2c { Test::Nginx::log_core('||', @_); } |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
287 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
288 ############################################################################### |