Mercurial > hg > nginx-tests
annotate fastcgi_request_buffering_chunked.t @ 1990:85d88cd5091c
Tests: SSI include stub tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:42:55 +0300 |
parents | 1e79a9613813 |
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 with fastcgi backend, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
8 # chunked transfer-encoding. |
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 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
12 use warnings; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
13 use strict; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
14 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
15 use Test::More; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
16 use Socket qw/ CRLF /; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
17 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
18 BEGIN { use FindBin; chdir($FindBin::Bin); } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
19 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
20 use lib 'lib'; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
21 use Test::Nginx; |
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 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
25 select STDERR; $| = 1; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
26 select STDOUT; $| = 1; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
27 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
28 eval { require FCGI; }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
29 plan(skip_all => 'FCGI not installed') if $@; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
30 plan(skip_all => 'win32') if $^O eq 'MSWin32'; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
31 |
568
907e89fba9c3
Tests: removed TODO and try_run() checks for legacy versions.
Sergey Kandaurov <pluknet@nginx.com>
parents:
545
diff
changeset
|
32 my $t = Test::Nginx->new()->has(qw/http fastcgi rewrite/)->plan(19); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
33 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
34 $t->write_file_expand('nginx.conf', <<'EOF'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
35 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
36 %%TEST_GLOBALS%% |
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 daemon off; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
39 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
40 events { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
41 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
42 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
43 http { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
44 %%TEST_GLOBALS_HTTP%% |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
45 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
46 server { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
47 listen 127.0.0.1:8080; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
48 server_name localhost; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
49 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
50 client_header_buffer_size 1k; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
51 fastcgi_request_buffering off; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
52 fastcgi_param REQUEST_URI $request_uri; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
53 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
54 location / { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
55 client_body_buffer_size 2k; |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
56 fastcgi_pass 127.0.0.1:8081; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
57 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
58 location /single { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
59 client_body_in_single_buffer on; |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
60 fastcgi_pass 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 /preread { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
63 fastcgi_pass 127.0.0.1:8082; |
542
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 /error_page { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
66 fastcgi_pass 127.0.0.1:8081; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
67 error_page 404 /404; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
68 fastcgi_intercept_errors on; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
69 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
70 location /404 { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
71 return 200 "$request_body\n"; |
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 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
74 } |
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 EOF |
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 $t->run_daemon(\&fastcgi_daemon); |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
79 $t->run()->waitforsocket('127.0.0.1:' . port(8081)); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
80 |
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 |
545
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
83 like(http_get('/'), qr/X-Body: \x0d\x0a?/ms, 'no body'); |
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 like(http_get_body('/', '0123456789'), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
86 qr/X-Body: 0123456789\x0d?$/ms, 'body'); |
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 like(http_get_body('/', '0123456789' x 128), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
89 qr/X-Body: (0123456789){128}\x0d?$/ms, 'body in two buffers'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
90 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
91 like(http_get_body('/single', '0123456789' x 128), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
92 qr/X-Body: (0123456789){128}\x0d?$/ms, 'body in single buffer'); |
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 like(http_get_body('/error_page', '0123456789'), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
95 qr/^0123456789$/m, 'body in error page'); |
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 # pipelined requests |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
98 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
99 like(http_get_body('/', '0123456789', '0123456789' x 128, '0123456789' x 512, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
100 'foobar'), qr/X-Body: foobar\x0d?$/ms, 'body pipelined'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
101 like(http_get_body('/', '0123456789' x 128, '0123456789' x 512, '0123456789', |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
102 'foobar'), qr/X-Body: foobar\x0d?$/ms, 'body pipelined 2'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
103 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
104 # interactive tests |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
105 |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
106 my $s = get_body('/preread', port(8082)); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
107 ok($s, 'no preread'); |
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 SKIP: { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
110 skip 'no preread failed', 3 unless $s; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
111 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
112 is($s->{upload}('01234'), '01234', 'no preread - body part'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
113 is($s->{upload}('56789', last => 1), '56789', 'no preread - body part 2'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
114 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
115 like($s->{http_end}(), qr/200 OK/, 'no preread - response'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
116 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
117 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
118 |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
119 $s = get_body('/preread', port(8082), '01234'); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
120 ok($s, 'preread'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
121 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
122 SKIP: { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
123 skip 'preread failed', 3 unless $s; |
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 is($s->{preread}, '01234', 'preread - preread'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
126 is($s->{upload}('56789', last => 1), '56789', 'preread - body'); |
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 like($s->{http_end}(), qr/200 OK/, 'preread - response'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
129 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
130 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
131 |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
132 $s = get_body('/preread', port(8082), '01234', many => 1); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
133 ok($s, 'chunks'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
134 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
135 SKIP: { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
136 skip 'chunks failed', 3 unless $s; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
137 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
138 is($s->{preread}, '01234many', 'chunks - preread'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
139 is($s->{upload}('56789', many => 1, last => 1), '56789many', 'chunks - body'); |
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 like($s->{http_end}(), qr/200 OK/, 'chunks - response'); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
142 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
143 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
144 |
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 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
147 sub http_get_body { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
148 my $uri = shift; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
149 my $last = pop; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
150 return http( join '', (map { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
151 my $body = $_; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
152 "GET $uri HTTP/1.1" . CRLF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
153 . "Host: localhost" . CRLF |
545
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
154 . "Transfer-Encoding: chunked" . CRLF . CRLF |
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
155 . sprintf("%x", length $body) . CRLF |
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
156 . $body . CRLF |
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
157 . "0" . CRLF . CRLF |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
158 } @_), |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
159 "GET $uri HTTP/1.1" . CRLF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
160 . "Host: localhost" . CRLF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
161 . "Connection: close" . CRLF |
545
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
162 . "Transfer-Encoding: chunked" . CRLF . CRLF |
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
163 . sprintf("%x", length $last) . CRLF |
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
164 . $last . CRLF |
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
165 . "0" . CRLF . CRLF |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
166 ); |
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 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
169 # Simple FastCGI responder implementation. |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
170 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
171 # http://www.fastcgi.com/devkit/doc/fcgi-spec.html |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
172 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
173 sub fastcgi_read_record($) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
174 my ($buf) = @_; |
925
6bb1f2ccd386
Tests: removed unused variables.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
837
diff
changeset
|
175 my $h; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
176 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
177 return undef unless length $$buf; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
178 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
179 @{$h}{qw/ version type id clen plen /} = unpack("CCnnC", $$buf); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
180 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
181 $h->{content} = substr $$buf, 8, $h->{clen}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
182 $h->{padding} = substr $$buf, 8 + $h->{clen}, $h->{plen}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
183 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
184 $$buf = substr $$buf, 8 + $h->{clen} + $h->{plen}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
185 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
186 return $h; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
187 } |
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 sub fastcgi_respond($$$$) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
190 my ($socket, $version, $id, $body) = @_; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
191 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
192 # stdout |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
193 $socket->write(pack("CCnnCx", $version, 6, $id, length($body), 8)); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
194 $socket->write($body); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
195 select(undef, undef, undef, 0.1); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
196 $socket->write(pack("xxxxxxxx")); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
197 select(undef, undef, undef, 0.1); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
198 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
199 # write some text to stdout and stderr split over multiple network |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
200 # packets to test if we correctly set pipe length in various places |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
201 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
202 my $tt = "test text, just for test"; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
203 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
204 $socket->write(pack("CCnnCx", $version, 6, $id, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
205 length($tt . $tt), 0) . $tt); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
206 select(undef, undef, undef, 0.1); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
207 $socket->write($tt . pack("CC", $version, 7)); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
208 select(undef, undef, undef, 0.1); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
209 $socket->write(pack("nnCx", $id, length($tt), 0)); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
210 select(undef, undef, undef, 0.1); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
211 $socket->write($tt); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
212 select(undef, undef, undef, 0.1); |
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 # close stdout |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
215 $socket->write(pack("CCnnCx", $version, 6, $id, 0, 0)); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
216 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
217 select(undef, undef, undef, 0.1); |
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 # end request |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
220 $socket->write(pack("CCnnCx", $version, 3, $id, 8, 0)); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
221 select(undef, undef, undef, 0.1); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
222 $socket->write(pack("NCxxx", 0, 0)); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
223 } |
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 sub get_body { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
226 my ($url, $port, $body, %extra) = @_; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
227 my ($server, $client, $s); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
228 my ($last, $many) = (0, 0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
229 my ($version, $id); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
230 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
231 $last = $extra{last} if defined $extra{last}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
232 $many = $extra{many} if defined $extra{many}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
233 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
234 $server = IO::Socket::INET->new( |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
235 Proto => 'tcp', |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
236 LocalHost => '127.0.0.1', |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
237 LocalPort => $port, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
238 Listen => 5, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
239 Reuse => 1 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
240 ) |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
241 or die "Can't create listening socket: $!\n"; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
242 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
243 my $r = <<EOF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
244 GET $url HTTP/1.1 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
245 Host: localhost |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
246 Connection: close |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
247 Transfer-Encoding: chunked |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
248 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
249 EOF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
250 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
251 if (defined $body) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
252 $r .= sprintf("%x", length $body) . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
253 $r .= $body . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
254 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
255 if (defined $body && $many) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
256 $r .= sprintf("%x", length 'many') . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
257 $r .= 'many' . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
258 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
259 if ($last) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
260 $r .= "0" . CRLF . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
261 } |
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 $s = http($r, start => 1); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
264 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
265 eval { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
266 local $SIG{ALRM} = sub { die "timeout\n" }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
267 local $SIG{PIPE} = sub { die "sigpipe\n" }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
268 alarm(5); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
269 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
270 $client = $server->accept(); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
271 |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
272 log2c("(new connection $client)"); |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
273 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
274 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
275 }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
276 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
277 if ($@) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
278 log_in("died: $@"); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
279 return undef; |
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 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
282 $client->sysread(my $buf, 1024); |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
283 log2i($buf); |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
284 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
285 $body = ''; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
286 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
287 while (my $h = fastcgi_read_record(\$buf)) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
288 $version = $h->{version}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
289 $id = $h->{id}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
290 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
291 # skip everything unless stdin |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
292 next if $h->{type} != 5; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
293 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
294 $body .= $h->{content}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
295 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
296 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
297 my $f = { preread => $body }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
298 $f->{upload} = sub { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
299 my ($body, %extra) = @_; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
300 my ($last, $many) = (0, 0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
301 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
302 $last = $extra{last} if defined $extra{last}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
303 $many = $extra{many} if defined $extra{many}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
304 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
305 my $buf = sprintf("%x", length $body) . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
306 $buf .= $body . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
307 if ($many) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
308 $buf .= sprintf("%x", length 'many') . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
309 $buf .= 'many' . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
310 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
311 if ($last) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
312 $buf .= "0" . CRLF . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
313 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
314 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
315 eval { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
316 local $SIG{ALRM} = sub { die "timeout\n" }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
317 local $SIG{PIPE} = sub { die "sigpipe\n" }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
318 alarm(5); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
319 |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
320 log_out($buf); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
321 $s->write($buf); |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
322 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
323 $client->sysread($buf, 1024); |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
324 log2i($buf); |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
325 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
326 $body = ''; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
327 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
328 while (my $h = fastcgi_read_record(\$buf)) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
329 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
330 # skip everything unless stdin |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
331 next if $h->{type} != 5; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
332 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
333 $body .= $h->{content}; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
334 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
335 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
336 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
337 }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
338 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
339 if ($@) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
340 log_in("died: $@"); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
341 return undef; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
342 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
343 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
344 return $body; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
345 }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
346 $f->{http_end} = sub { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
347 my $buf = ''; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
348 |
1167
1e79a9613813
Tests: handled SIGPIPE in fastcgi tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
349 eval { |
1e79a9613813
Tests: handled SIGPIPE in fastcgi tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
350 local $SIG{ALRM} = sub { die "timeout\n" }; |
1e79a9613813
Tests: handled SIGPIPE in fastcgi tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
351 local $SIG{PIPE} = sub { die "sigpipe\n" }; |
1e79a9613813
Tests: handled SIGPIPE in fastcgi tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
352 alarm(5); |
1e79a9613813
Tests: handled SIGPIPE in fastcgi tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
353 |
1e79a9613813
Tests: handled SIGPIPE in fastcgi tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
354 fastcgi_respond($client, $version, $id, <<EOF); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
355 Status: 200 OK |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
356 Connection: close |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
357 X-Port: $port |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
358 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
359 OK |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
360 EOF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
361 |
1167
1e79a9613813
Tests: handled SIGPIPE in fastcgi tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
362 $client->close; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
363 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
364 $s->sysread($buf, 1024); |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
365 log_in($buf); |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
366 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
367 $s->close(); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
368 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
369 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
370 }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
371 alarm(0); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
372 if ($@) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
373 log_in("died: $@"); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
374 return undef; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
375 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
376 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
377 return $buf; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
378 }; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
379 return $f; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
380 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
381 |
837
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
382 sub log2i { Test::Nginx::log_core('|| <<', @_); } |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
383 sub log2o { Test::Nginx::log_core('|| >>', @_); } |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
384 sub log2c { Test::Nginx::log_core('||', @_); } |
68a6678abae2
Tests: improved logging for unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
385 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
386 ############################################################################### |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
387 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
388 sub fastcgi_daemon { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
389 my $socket = FCGI::OpenSocket('127.0.0.1:' . port(8081), 5); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
390 my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
391 $socket); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
392 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
393 my $count; |
545
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
394 my ($body, $buf); |
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
395 |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
396 while( $request->Accept() >= 0 ) { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
397 $count++; |
545
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
398 $body = ''; |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
399 |
545
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
400 do { |
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
401 read(STDIN, $buf, 1024); |
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
402 $body .= $buf; |
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
403 } while (length $buf); |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
404 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
405 if ($ENV{REQUEST_URI} eq '/error_page') { |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
406 print "Status: 404 Not Found" . CRLF . CRLF; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
407 next; |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
408 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
409 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
410 print <<EOF; |
952
e9064d691790
Tests: converted tests to run in parallel.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
925
diff
changeset
|
411 Location: http://localhost/redirect |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
412 Content-Type: text/html |
545
dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
542
diff
changeset
|
413 X-Body: $body |
542
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
414 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
415 SEE-THIS |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
416 $count |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
417 EOF |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
418 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
419 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
420 FCGI::CloseSocket($socket); |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
421 } |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
422 |
e7e3ced702f5
Tests: unbuffered request body.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
423 ############################################################################### |