Mercurial > hg > nginx-tests
annotate proxy_noclose.t @ 1905:f35824e75b66
Tests: fixed reading QUIC streams on Perl < 5.24.
The parse_stream() routine has had a missing explicit return if there were no
streams received. In Perl < 5.24 this used to return no value, or an empty
array in the list context. In modern Perl this returns an empty value, or an
array of 1 element, which made the check for last index of the returned array
work rather by accident.
The fix is to return explicitly and to check the array size in callers instead.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 06 Jun 2023 18:50:07 +0400 |
parents | 882267679006 |
children |
rev | line source |
---|---|
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
3 # (C) Maxim Dounin |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
4 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
5 # Test for http backend not closing connection properly after sending full |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
6 # reply. This is in fact backend bug, but it seems common, and anyway |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 # correct handling is required to support persistent connections. |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
9 # There are actually 2 nginx problems here: |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
10 # |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
11 # 1. It doesn't send reply in-time even if got Content-Length and all the data. |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
12 # |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
13 # 2. If upstream times out some data may be left in input buffer and won't be |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
14 # sent to downstream. |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
15 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 ############################################################################### |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
18 use warnings; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 use strict; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 |
121
8ac1faaddd2c
Tests: better handle various configure arguments.
Maxim Dounin <mdounin@mdounin.ru>
parents:
113
diff
changeset
|
21 use Test::More; |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
22 |
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
23 use IO::Select; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 BEGIN { use FindBin; chdir($FindBin::Bin); } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
27 use lib 'lib'; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 use Test::Nginx; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 ############################################################################### |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 select STDERR; $| = 1; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 select STDOUT; $| = 1; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 |
121
8ac1faaddd2c
Tests: better handle various configure arguments.
Maxim Dounin <mdounin@mdounin.ru>
parents:
113
diff
changeset
|
35 my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(4); |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 $t->write_file_expand('nginx.conf', <<'EOF'); |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 |
107
1c0ec30614c6
Tests: add TEST_GLOBALS and TEST_GLOBALS_HTTP config chunks.
Maxim Dounin <mdounin@mdounin.ru>
parents:
83
diff
changeset
|
39 %%TEST_GLOBALS%% |
1c0ec30614c6
Tests: add TEST_GLOBALS and TEST_GLOBALS_HTTP config chunks.
Maxim Dounin <mdounin@mdounin.ru>
parents:
83
diff
changeset
|
40 |
249
6a0d934950bc
Tests: remove extra spaces in "daemon off".
Maxim Dounin <mdounin@mdounin.ru>
parents:
224
diff
changeset
|
41 daemon off; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
42 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 events { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
46 http { |
107
1c0ec30614c6
Tests: add TEST_GLOBALS and TEST_GLOBALS_HTTP config chunks.
Maxim Dounin <mdounin@mdounin.ru>
parents:
83
diff
changeset
|
47 %%TEST_GLOBALS_HTTP%% |
35
7bf0e8a1d66c
Tests: always define temp paths.
Maxim Dounin <mdounin@mdounin.ru>
parents:
29
diff
changeset
|
48 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 server { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
50 listen 127.0.0.1:8080; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 server_name localhost; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
52 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
53 location / { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
54 proxy_pass http://127.0.0.1:8081; |
750
71dfce15bbba
Tests: fixed proxy_noclose.t timeouts on painfully slow hosts.
Sergey Kandaurov <pluknet@nginx.com>
parents:
295
diff
changeset
|
55 proxy_read_timeout 2s; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
56 } |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
57 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
58 location /uselen { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
59 proxy_pass http://127.0.0.1:8081; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
60 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
61 # test will wait only 2s for reply, we it will fail if |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
62 # Content-Length not used as a hint |
113
5d31f920eda9
Tests: whitespace cleanup, no functional changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
107
diff
changeset
|
63 |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
64 proxy_read_timeout 10s; |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
65 } |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
66 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
67 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
68 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
69 EOF |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
70 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
71 $t->run_daemon(\&http_noclose_daemon); |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
72 $t->run()->waitforsocket('127.0.0.1:' . port(8081)); |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
73 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
74 ############################################################################### |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
75 |
224
ba992cfdc606
Tests: remove TODO from tests which pass in 1.2.x.
Maxim Dounin <mdounin@mdounin.ru>
parents:
166
diff
changeset
|
76 like(http_get('/'), qr/SEE-THIS/, 'request to bad backend'); |
ba992cfdc606
Tests: remove TODO from tests which pass in 1.2.x.
Maxim Dounin <mdounin@mdounin.ru>
parents:
166
diff
changeset
|
77 like(http_get('/multi'), qr/AND-THIS/, 'bad backend - multiple packets'); |
ba992cfdc606
Tests: remove TODO from tests which pass in 1.2.x.
Maxim Dounin <mdounin@mdounin.ru>
parents:
166
diff
changeset
|
78 like(http_get('/uselen'), qr/SEE-THIS/, 'content-length actually used'); |
ba992cfdc606
Tests: remove TODO from tests which pass in 1.2.x.
Maxim Dounin <mdounin@mdounin.ru>
parents:
166
diff
changeset
|
79 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
80 TODO: { |
224
ba992cfdc606
Tests: remove TODO from tests which pass in 1.2.x.
Maxim Dounin <mdounin@mdounin.ru>
parents:
166
diff
changeset
|
81 local $TODO = 'not yet'; |
72
24143894b91b
Tests: shut up warnings for TODO tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
64
diff
changeset
|
82 local $SIG{__WARN__} = sub {}; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
83 |
29
71ea39729fa0
Tests: memcached module generic tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
25
diff
changeset
|
84 like(http_get('/nolen'), qr/SEE-THIS/, 'bad backend - no content length'); |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
85 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
86 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
87 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
88 ############################################################################### |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
89 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
90 sub http_noclose_daemon { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
91 my $server = IO::Socket::INET->new( |
83
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
92 Proto => 'tcp', |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
93 LocalAddr => '127.0.0.1:' . port(8081), |
83
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
94 Listen => 5, |
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
95 Reuse => 1 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
96 ) |
83
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
97 or die "Can't create listening socket: $!\n"; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
98 |
295
6fe0459b6668
Tests: eliminate startup races in proxy and fastcgi tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
249
diff
changeset
|
99 local $SIG{PIPE} = 'IGNORE'; |
6fe0459b6668
Tests: eliminate startup races in proxy and fastcgi tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
249
diff
changeset
|
100 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 while (my $client = $server->accept()) { |
83
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
102 $client->autoflush(1); |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
103 |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
104 my $multi = 0; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
105 my $nolen = 0; |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
106 |
83
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
107 while (<$client>) { |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
108 $multi = 1 if /multi/; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
109 $nolen = 1 if /nolen/; |
83
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
110 last if (/^\x0d?\x0a?$/); |
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
111 } |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
112 |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
113 if ($nolen) { |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
114 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
115 print $client <<'EOF'; |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
116 HTTP/1.1 200 OK |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
117 Connection: close |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
118 |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
119 TEST-OK-IF-YOU-SEE-THIS |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
120 EOF |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
121 } elsif ($multi) { |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
122 |
83
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
123 print $client <<"EOF"; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
124 HTTP/1.1 200 OK |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
125 Content-Length: 32 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
126 Connection: close |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
127 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
128 TEST-OK-IF-YOU-SEE-THIS |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
129 EOF |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
130 |
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
131 select undef, undef, undef, 0.1; |
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
132 print $client 'AND-THIS'; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
133 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
134 } else { |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
135 |
83
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
136 print $client <<"EOF"; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
137 HTTP/1.1 200 OK |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
138 Content-Length: 24 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
139 Connection: close |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
140 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
141 TEST-OK-IF-YOU-SEE-THIS |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
142 EOF |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
143 } |
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
144 |
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
145 my $select = IO::Select->new($client); |
83
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
146 $select->can_read(10); |
6e5884419e4a
Tests: whitespace cleanup.
Maxim Dounin <mdounin@mdounin.ru>
parents:
72
diff
changeset
|
147 close $client; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
148 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
149 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
150 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
151 ############################################################################### |