Mercurial > hg > nginx-tests
annotate proxy-noclose.t @ 57:b5b4271554b0
Test: use TODO for smtp pipelining tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sun, 11 Jan 2009 20:33:59 +0300 |
parents | d68b85def521 |
children | 726c3c2a8b8c |
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 |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
21 use Test::More tests => 4; |
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 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 my $t = Test::Nginx->new(); |
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 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 master_process off; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 daemon off; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
41 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
42 events { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 worker_connections 1024; |
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 { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
47 access_log off; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
48 root %%TESTDIR%%; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 |
35
7bf0e8a1d66c
Tests: always define temp paths.
Maxim Dounin <mdounin@mdounin.ru>
parents:
29
diff
changeset
|
50 client_body_temp_path %%TESTDIR%%/client_body_temp; |
7bf0e8a1d66c
Tests: always define temp paths.
Maxim Dounin <mdounin@mdounin.ru>
parents:
29
diff
changeset
|
51 fastcgi_temp_path %%TESTDIR%%/fastcgi_temp; |
7bf0e8a1d66c
Tests: always define temp paths.
Maxim Dounin <mdounin@mdounin.ru>
parents:
29
diff
changeset
|
52 proxy_temp_path %%TESTDIR%%/proxy_temp; |
7bf0e8a1d66c
Tests: always define temp paths.
Maxim Dounin <mdounin@mdounin.ru>
parents:
29
diff
changeset
|
53 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
54 server { |
45
d68b85def521
Tests: use 127.0.0.1 instead of localhost.
Maxim Dounin <mdounin@mdounin.ru>
parents:
44
diff
changeset
|
55 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
|
56 server_name localhost; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
57 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
58 location / { |
45
d68b85def521
Tests: use 127.0.0.1 instead of localhost.
Maxim Dounin <mdounin@mdounin.ru>
parents:
44
diff
changeset
|
59 proxy_pass http://127.0.0.1:8081; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
60 proxy_read_timeout 1s; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
61 } |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
62 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
63 location /uselen { |
45
d68b85def521
Tests: use 127.0.0.1 instead of localhost.
Maxim Dounin <mdounin@mdounin.ru>
parents:
44
diff
changeset
|
64 proxy_pass http://127.0.0.1:8081; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
65 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
66 # 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
|
67 # Content-Length not used as a hint |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
68 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
69 proxy_read_timeout 10s; |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
70 } |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
71 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
72 } |
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 EOF |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
75 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
76 $t->run_daemon(\&http_noclose_daemon); |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
77 $t->run(); |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
78 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
79 ############################################################################### |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
80 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
81 TODO: { |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
82 local $TODO = 'not fixed yet, patches under review'; |
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('/'), qr/SEE-THIS/, 'request to bad backend'); |
71ea39729fa0
Tests: memcached module generic tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
25
diff
changeset
|
85 like(http_get('/multi'), qr/AND-THIS/, 'bad backend - multiple packets'); |
71ea39729fa0
Tests: memcached module generic tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
25
diff
changeset
|
86 like(http_get('/nolen'), qr/SEE-THIS/, 'bad backend - no content length'); |
71ea39729fa0
Tests: memcached module generic tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
25
diff
changeset
|
87 like(http_get('/uselen'), qr/SEE-THIS/, 'content-length actually used'); |
21
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 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
91 ############################################################################### |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
92 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
93 sub http_noclose_daemon { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
94 my $server = IO::Socket::INET->new( |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
95 Proto => 'tcp', |
44
daa295331acd
Tests: don't bind backend daemons to *, use 127.0.0.1 instead.
Maxim Dounin <mdounin@mdounin.ru>
parents:
35
diff
changeset
|
96 LocalAddr => '127.0.0.1:8081', |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
97 Listen => 5, |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
98 Reuse => 1 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
99 ) |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
100 or die "Can't create listening socket: $!\n"; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
102 while (my $client = $server->accept()) { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
103 $client->autoflush(1); |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
104 |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
105 my $multi = 0; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
106 my $nolen = 0; |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
107 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
108 while (<$client>) { |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
109 $multi = 1 if /multi/; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
110 $nolen = 1 if /nolen/; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
111 last if (/^\x0d?\x0a?$/); |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
112 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
113 |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
114 if ($nolen) { |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
115 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
116 print $client <<'EOF'; |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
117 HTTP/1.1 200 OK |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
118 Connection: close |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
119 |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
120 TEST-OK-IF-YOU-SEE-THIS |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
121 EOF |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
122 } elsif ($multi) { |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
123 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
124 print $client <<"EOF"; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
125 HTTP/1.1 200 OK |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
126 Content-Length: 32 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
127 Connection: close |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
128 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
129 TEST-OK-IF-YOU-SEE-THIS |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
130 EOF |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
131 |
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
132 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
|
133 print $client 'AND-THIS'; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
134 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
135 } else { |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
136 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
137 print $client <<"EOF"; |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
138 HTTP/1.1 200 OK |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
139 Content-Length: 24 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
140 Connection: close |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
141 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
142 TEST-OK-IF-YOU-SEE-THIS |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
143 EOF |
23
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 |
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
146 my $select = IO::Select->new($client); |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
147 $select->can_read(10); |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
148 close $client; |
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 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
152 ############################################################################### |