Mercurial > hg > nginx-tests
annotate proxy_available.t @ 1990:85d88cd5091c
Tests: SSI include stub tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:42:55 +0300 |
parents | a095b971fbcc |
children |
rev | line source |
---|---|
1779
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
2 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
3 # (C) Sergey Kandaurov |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
4 # (C) Nginx, Inc. |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
5 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
6 # Tests for http proxy module with available bytes counting. |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
7 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
8 ############################################################################### |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
9 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
10 use warnings; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
11 use strict; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
12 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
13 use Test::More; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
14 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
15 use IO::Select; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
16 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
17 BEGIN { use FindBin; chdir($FindBin::Bin); } |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
18 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
19 use lib 'lib'; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
20 use Test::Nginx qw/ :DEFAULT http_end /; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
21 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
22 ############################################################################### |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
23 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
24 select STDERR; $| = 1; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
25 select STDOUT; $| = 1; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
26 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
27 my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(2); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
28 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
29 $t->write_file_expand('nginx.conf', <<'EOF'); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
30 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
31 %%TEST_GLOBALS%% |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
32 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
33 daemon off; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
34 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
35 events { |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
36 } |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
37 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
38 http { |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
39 %%TEST_GLOBALS_HTTP%% |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
40 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
41 server { |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
42 listen 127.0.0.1:8080; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
43 server_name localhost; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
44 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
45 location /buffered { |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
46 proxy_pass http://127.0.0.1:8081; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
47 proxy_buffer_size 512; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
48 } |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
49 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
50 location /unbuffered { |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
51 proxy_pass http://127.0.0.1:8082; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
52 proxy_buffer_size 512; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
53 proxy_buffering off; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
54 } |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
55 } |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
56 } |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
57 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
58 EOF |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
59 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
60 $t->run_daemon(\&http_daemon, port(8081)); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
61 $t->run_daemon(\&http_daemon, port(8082)); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
62 $t->run(); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
63 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
64 $t->waitforsocket('127.0.0.1:' . port(8081)); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
65 $t->waitforsocket('127.0.0.1:' . port(8082)); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
66 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
67 ############################################################################### |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
68 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
69 # ticket #2367: socket leaks with EPOLLRDHUP |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
70 # due to missing rev->ready reset on rev->available == 0 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
71 # |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
72 # to reproduce leaks, the first part of the response should fit proxy buffer |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
73 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
74 my $s = http_get('/buffered', start => 1); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
75 IO::Select->new($s)->can_read(3); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
76 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
77 $t->reload(); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
78 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
79 like(http_end($s), qr/AND-THIS/, 'zero available - buffered'); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
80 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
81 $s = http_get('/unbuffered', start => 1); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
82 IO::Select->new($s)->can_read(3); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
83 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
84 $t->stop(); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
85 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
86 like(http_end($s), qr/AND-THIS/, 'zero available - unbuffered'); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
87 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
88 ############################################################################### |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
89 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
90 sub http_daemon { |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
91 my ($port) = @_; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
92 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
93 my $server = IO::Socket::INET->new( |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
94 Proto => 'tcp', |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
95 LocalHost => "127.0.0.1:$port", |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
96 Listen => 5, |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
97 Reuse => 1 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
98 ) |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
99 or die "Can't create listening socket: $!\n"; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
100 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
101 local $SIG{PIPE} = 'IGNORE'; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
102 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
103 while (my $client = $server->accept()) { |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
104 $client->autoflush(1); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
105 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
106 my $headers = ''; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
107 my $uri = ''; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
108 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
109 while (<$client>) { |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
110 $headers .= $_; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
111 last if (/^\x0d?\x0a?$/); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
112 } |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
113 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
114 next if $headers eq ''; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
115 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
116 my $r = <<EOF; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
117 HTTP/1.1 200 OK |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
118 Connection: close |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
119 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
120 EOF |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
121 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
122 $r = $r . 'x' x (512 - length($r)); |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
123 print $client $r; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
124 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
125 select undef, undef, undef, 1.1; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
126 print $client 'AND-THIS'; |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
127 } |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
128 } |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
129 |
4b80f1ab7fdc
Tests: socket leaks with zero available bytes (ticket #2367).
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
130 ############################################################################### |