Mercurial > hg > nginx-tests
annotate proxy-noclose.t @ 28:8f1519472ece
Tests: unbreak and extend has() functionality.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 10 Oct 2008 20:23:39 +0400 |
parents | fbda19df2fc4 |
children | 71ea39729fa0 |
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 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
50 server { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 listen localhost:8080; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
52 server_name localhost; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
53 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
54 location / { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
55 proxy_pass http://localhost:8081; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
56 proxy_read_timeout 1s; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
57 } |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
58 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
59 location /uselen { |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
60 proxy_pass http://localhost:8081; |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
61 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
62 # 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
|
63 # Content-Length not used as a hint |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
64 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
65 proxy_read_timeout 10s; |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
66 } |
21
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 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
70 EOF |
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 $t->run_daemon(\&http_noclose_daemon); |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
73 $t->run(); |
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 ############################################################################### |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
76 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
77 TODO: { |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
78 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
|
79 |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
80 like(http_request('/'), qr/SEE-THIS/, 'request to bad backend'); |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
81 like(http_request('/multi'), qr/AND-THIS/, 'bad backend - multiple packets'); |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
82 like(http_request('/nolen'), qr/SEE-THIS/, 'bad backend - no content length'); |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
83 like(http_request('/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
|
84 |
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 sub http_request { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
90 my ($url) = @_; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
91 my $r = http(<<EOF); |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
92 GET $url HTTP/1.1 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
93 Host: localhost |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
94 Connection: close |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
95 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
96 EOF |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
97 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
98 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
99 sub http_noclose_daemon { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
100 my $server = IO::Socket::INET->new( |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 Proto => 'tcp', |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
102 LocalPort => 8081, |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
103 Listen => 5, |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
104 Reuse => 1 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
105 ) |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
106 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
|
107 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
108 while (my $client = $server->accept()) { |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
109 $client->autoflush(1); |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
110 |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
111 my $multi = 0; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
112 my $nolen = 0; |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
113 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
114 while (<$client>) { |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
115 $multi = 1 if /multi/; |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
116 $nolen = 1 if /nolen/; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
117 last if (/^\x0d?\x0a?$/); |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
118 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
119 |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
120 if ($nolen) { |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
121 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
122 print $client <<'EOF'; |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
123 HTTP/1.1 200 OK |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
124 Connection: close |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
125 |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
126 TEST-OK-IF-YOU-SEE-THIS |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
127 EOF |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
128 } elsif ($multi) { |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
129 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
130 print $client <<"EOF"; |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
131 HTTP/1.1 200 OK |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
132 Content-Length: 32 |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
133 Connection: close |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
134 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
135 TEST-OK-IF-YOU-SEE-THIS |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
136 EOF |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
137 |
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
138 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
|
139 print $client 'AND-THIS'; |
25
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 } else { |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
142 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
143 print $client <<"EOF"; |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
144 HTTP/1.1 200 OK |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
145 Content-Length: 24 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
146 Connection: close |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
147 |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
148 TEST-OK-IF-YOU-SEE-THIS |
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
149 EOF |
23
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
150 } |
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
151 |
e6b7c3b5389c
Tests: test for multiple buffers in proxy-noclose.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
22
diff
changeset
|
152 my $select = IO::Select->new($client); |
25
fbda19df2fc4
Tests: more proxy-noclose tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
23
diff
changeset
|
153 $select->can_read(10); |
21
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
154 close $client; |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
155 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
156 } |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
157 |
a2144333aa8f
Tests: todo test for buggy backends not closing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
158 ############################################################################### |