Mercurial > hg > nginx-tests
annotate http_header_buffers.t @ 1990:85d88cd5091c
Tests: SSI include stub tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:42:55 +0300 |
parents | 66c7dee0431c |
children |
rev | line source |
---|---|
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
3 # (C) Maxim Dounin |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
4 # (C) Nginx, Inc. |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
5 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
6 # Tests for large_client_header_buffers directive. |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 ############################################################################### |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
10 use warnings; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 use strict; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
12 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
13 use Test::More; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
15 use Socket qw/ CRLF /; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 BEGIN { use FindBin; chdir($FindBin::Bin); } |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
18 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 use lib 'lib'; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 use Test::Nginx; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
21 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 ############################################################################### |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 select STDERR; $| = 1; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 select STDOUT; $| = 1; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 |
1144
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
27 my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(10) |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 ->write_file_expand('nginx.conf', <<'EOF'); |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 %%TEST_GLOBALS%% |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 daemon off; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 events { |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 } |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 http { |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 %%TEST_GLOBALS_HTTP%% |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 |
1136
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
40 connection_pool_size 128; |
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
41 client_header_buffer_size 128; |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
42 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 server { |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 listen 127.0.0.1:8080; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 server_name five; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
46 |
1136
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
47 large_client_header_buffers 5 256; |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
48 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 return 204; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
50 } |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
52 server { |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
53 listen 127.0.0.1:8080; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
54 server_name ten; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
55 |
1136
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
56 large_client_header_buffers 10 256; |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
57 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
58 return 204; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
59 } |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
60 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
61 server { |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
62 listen 127.0.0.1:8080; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
63 server_name one; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
64 |
1136
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
65 large_client_header_buffers 1 256; |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
66 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
67 return 204; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
68 } |
1143
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
69 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
70 server { |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
71 listen 127.0.0.1:8080; |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
72 server_name foo; |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
73 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
74 large_client_header_buffers 5 256; |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
75 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
76 add_header X-URI $uri; |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
77 add_header X-Foo $http_x_foo; |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
78 return 204; |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
79 } |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
80 } |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
81 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
82 EOF |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
83 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
84 $t->run(); |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
85 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
86 ############################################################################### |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
87 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
88 TODO: { |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
89 todo_skip 'overflow', 2 unless $ENV{TEST_NGINX_UNSAFE}; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
90 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
91 # if hc->busy is allocated before the virtual server is selected, |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
92 # and then additional buffers are allocated in a virtual server with larger |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
93 # number of buffers configured, hc->busy will be overflowed |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
94 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
95 like(http( |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
96 "GET / HTTP/1.0" . CRLF . |
1136
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
97 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
98 "Host: ten" . CRLF . |
1136
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
99 "X-Foo: " . ("1234567890" x 20) . CRLF . |
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
100 "X-Foo: " . ("1234567890" x 20) . CRLF . |
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
101 "X-Foo: " . ("1234567890" x 20) . CRLF . |
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
102 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1143
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
103 "X-Foo: " . ("1234567890" x 20) . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
104 CRLF |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
105 ), qr/204|400/, 'additional buffers in virtual server'); |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
106 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
107 # for pipelined requests large header buffers are saved to hc->free; |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
108 # it sized for number of buffers in the current virtual server, but |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
109 # saves previously allocated buffers, and there may be more buffers if |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
110 # allocatad before the virtual server was selected |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
111 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
112 like(http( |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
113 "GET / HTTP/1.1" . CRLF . |
1136
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
114 "X-Foo: " . ("1234567890" x 20) . CRLF . |
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
115 "X-Foo: " . ("1234567890" x 20) . CRLF . |
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
116 "X-Foo: " . ("1234567890" x 20) . CRLF . |
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
117 "X-Foo: " . ("1234567890" x 20) . CRLF . |
56d5efd16af6
Tests: pool size in header tests fixed for 64-bit platforms.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1135
diff
changeset
|
118 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1143
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
119 "Host: one" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
120 CRLF . |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
121 "GET / HTTP/1.1" . CRLF . |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
122 "Host: one" . CRLF . |
1143
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
123 "Connection: close" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
124 CRLF |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
125 ), qr/204/, 'pipelined with too many buffers'); |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
126 |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
127 } |
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
128 |
1143
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
129 # check if long header and long request lines are correctly returned |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
130 # when nginx allocates a long header buffer |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
131 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
132 like(http( |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
133 "GET / HTTP/1.0" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
134 "Host: foo" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
135 "X-Foo: foo" . ("1234567890" x 20) . "bar" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
136 CRLF |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
137 ), qr/X-Foo: foo(1234567890){20}bar/, 'long header'); |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
138 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
139 like(http( |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
140 "GET /foo" . ("1234567890" x 20) . "bar HTTP/1.0" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
141 "Host: foo" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
142 CRLF |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
143 ), qr!X-URI: /foo(1234567890){20}bar!, 'long request line'); |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
144 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
145 # the same as the above, but with pipelining, so there is a buffer |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
146 # allocated in the previous request |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
147 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
148 like(http( |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
149 "GET / HTTP/1.1" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
150 "Host: foo" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
151 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1144
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
152 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
153 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1143
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
154 CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
155 "GET / HTTP/1.1" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
156 "Host: foo" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
157 "Connection: close" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
158 "X-Foo: foo" . ("1234567890" x 20) . "bar" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
159 CRLF |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
160 ), qr/X-Foo: foo(1234567890){20}bar/, 'long header after pipelining'); |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
161 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
162 like(http( |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
163 "GET / HTTP/1.1" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
164 "Host: foo" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
165 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1144
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
166 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
167 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1143
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
168 CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
169 "GET /foo" . ("1234567890" x 20) . "bar HTTP/1.1" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
170 "Host: foo" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
171 "Connection: close" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
172 CRLF |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
173 ), qr!X-URI: /foo(1234567890){20}bar!, 'long request line after pipelining'); |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
174 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
175 # the same as the above, but with keepalive; this ensures that previously |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
176 # allocated buffers are properly cleaned up when we set keepalive handler |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
177 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
178 like(http( |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
179 "GET / HTTP/1.1" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
180 "Host: foo" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
181 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1144
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
182 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
183 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1143
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
184 CRLF, |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
185 sleep => 0.1, body => |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
186 "GET / HTTP/1.1" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
187 "Host: foo" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
188 "Connection: close" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
189 "X-Foo: foo" . ("1234567890" x 20) . "bar" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
190 CRLF |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
191 ), qr/X-Foo: foo(1234567890){20}bar/, 'long header after keepalive'); |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
192 |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
193 like(http( |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
194 "GET / HTTP/1.1" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
195 "Host: foo" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
196 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1144
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
197 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
198 "X-Foo: " . ("1234567890" x 20) . CRLF . |
1143
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
199 CRLF, |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
200 sleep => 0.1, body => |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
201 "GET /foo" . ("1234567890" x 20) . "bar HTTP/1.1" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
202 "Host: foo" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
203 "Connection: close" . CRLF . |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
204 CRLF |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
205 ), qr!X-URI: /foo(1234567890){20}bar!, 'long request line after keepalive'); |
b9d9c962255f
Tests: more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1136
diff
changeset
|
206 |
1144
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
207 # the same as the above, but with pipelining and then keepalive; |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
208 # this ensures that previously allocated buffers are properly cleaned |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
209 # up when we set keepalive handler, including hc->free |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
210 |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
211 like(http( |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
212 "GET / HTTP/1.1" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
213 "Host: foo" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
214 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
215 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
216 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
217 CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
218 "GET / HTTP/1.1" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
219 "Host: foo" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
220 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
221 CRLF, |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
222 sleep => 0.1, body => |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
223 "GET / HTTP/1.1" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
224 "Host: foo" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
225 "Connection: close" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
226 "X-Foo: foo" . ("1234567890" x 20) . "bar" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
227 CRLF |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
228 ), qr/X-Foo: foo(1234567890){20}bar/, 'long header after both'); |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
229 |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
230 like(http( |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
231 "GET / HTTP/1.1" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
232 "Host: foo" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
233 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
234 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
235 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
236 CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
237 "GET / HTTP/1.1" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
238 "Host: foo" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
239 "X-Foo: " . ("1234567890" x 20) . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
240 CRLF, |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
241 sleep => 0.1, body => |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
242 "GET /foo" . ("1234567890" x 20) . "bar HTTP/1.1" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
243 "Host: foo" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
244 "Connection: close" . CRLF . |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
245 CRLF |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
246 ), qr!X-URI: /foo(1234567890){20}bar!, 'long request line after both'); |
66c7dee0431c
Tests: some more large_client_header_buffers tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1143
diff
changeset
|
247 |
1135
3f875d5be63f
Tests for large_client_header_buffers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
248 ############################################################################### |