Mercurial > hg > nginx-tests
annotate spdy.t @ 576:239ade56c015
Tests: more proxy_cache_lock_age tests.
Reflect that when an aged request completes, the response updates proxy cache.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 14 May 2015 17:28:52 +0300 |
parents | 2cd00179f4b2 |
children | 8593f34a12e5 |
rev | line source |
---|---|
374 | 1 #!/usr/bin/perl |
2 | |
3 # (C) Sergey Kandaurov | |
4 # (C) Nginx, Inc. | |
5 | |
6 # Tests for SPDY protocol version 3.1. | |
7 | |
8 ############################################################################### | |
9 | |
10 use warnings; | |
11 use strict; | |
12 | |
13 use Test::More; | |
14 | |
15 use IO::Select; | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
16 use Socket qw/ CRLF /; |
374 | 17 |
18 BEGIN { use FindBin; chdir($FindBin::Bin); } | |
19 | |
20 use lib 'lib'; | |
21 use Test::Nginx; | |
22 | |
23 ############################################################################### | |
24 | |
25 select STDERR; $| = 1; | |
26 select STDOUT; $| = 1; | |
27 | |
28 eval { | |
29 require Compress::Raw::Zlib; | |
30 Compress::Raw::Zlib->Z_OK; | |
31 Compress::Raw::Zlib->Z_SYNC_FLUSH; | |
32 Compress::Raw::Zlib->Z_NO_COMPRESSION; | |
33 Compress::Raw::Zlib->WANT_GZIP_OR_ZLIB; | |
34 }; | |
35 plan(skip_all => 'Compress::Raw::Zlib not installed') if $@; | |
36 | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
37 my $t = Test::Nginx->new() |
574
2cd00179f4b2
Tests: has_feature() introduced in Test::Nginx.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
38 ->has(qw/http proxy cache limit_conn rewrite spdy realip shmem/); |
374 | 39 |
487
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
40 $t->plan(82)->write_file_expand('nginx.conf', <<'EOF'); |
374 | 41 |
42 %%TEST_GLOBALS%% | |
43 | |
44 daemon off; | |
45 | |
46 events { | |
47 } | |
48 | |
49 http { | |
50 %%TEST_GLOBALS_HTTP%% | |
51 | |
503
071e8941e3bf
Tests: reduce shared memory zone sizes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
488
diff
changeset
|
52 proxy_cache_path %%TESTDIR%%/cache keys_zone=NAME:1m; |
374 | 53 limit_conn_zone $binary_remote_addr zone=conn:1m; |
54 | |
55 server { | |
56 listen 127.0.0.1:8080 spdy; | |
57 listen 127.0.0.1:8081; | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
58 listen 127.0.0.1:8082 proxy_protocol spdy; |
374 | 59 server_name localhost; |
60 | |
61 location /s { | |
62 add_header X-Header X-Foo; | |
63 return 200 'body'; | |
64 } | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
65 location /pp { |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
66 set_real_ip_from 127.0.0.1/32; |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
67 real_ip_header proxy_protocol; |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
68 alias %%TESTDIR%%/t2.html; |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
69 add_header X-PP $remote_addr; |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
70 } |
374 | 71 location /spdy { |
72 return 200 $spdy; | |
73 } | |
74 location /prio { | |
75 return 200 $spdy_request_priority; | |
76 } | |
77 location /chunk_size { | |
78 spdy_chunk_size 1; | |
79 return 200 'body'; | |
80 } | |
81 location /redirect { | |
82 error_page 405 /s; | |
83 return 405; | |
84 } | |
85 location /proxy { | |
86 add_header X-Body "$request_body"; | |
87 proxy_pass http://127.0.0.1:8081/; | |
88 proxy_cache NAME; | |
89 proxy_cache_valid 1m; | |
90 } | |
487
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
91 location /header/ { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
92 proxy_pass http://127.0.0.1:8083/; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
93 } |
428
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
94 location /proxy_buffering_off { |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
95 proxy_pass http://127.0.0.1:8081/; |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
96 proxy_cache NAME; |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
97 proxy_cache_valid 1m; |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
98 proxy_buffering off; |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
99 } |
374 | 100 location /t3.html { |
101 limit_conn conn 1; | |
102 } | |
442
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
103 location /set-cookie { |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
104 add_header Set-Cookie val1; |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
105 add_header Set-Cookie val2; |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
106 return 200; |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
107 } |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
108 location /cookie { |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
109 add_header X-Cookie $http_cookie; |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
110 return 200; |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
111 } |
374 | 112 } |
113 } | |
114 | |
115 EOF | |
116 | |
487
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
117 $t->run_daemon(\&http_daemon); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
118 $t->run()->waitforsocket('127.0.0.1:8083'); |
374 | 119 |
120 # file size is slightly beyond initial window size: 2**16 + 80 bytes | |
121 | |
122 $t->write_file('t1.html', | |
123 join('', map { sprintf "X%04dXXX", $_ } (1 .. 8202))); | |
124 | |
125 $t->write_file('t2.html', 'SEE-THIS'); | |
126 $t->write_file('t3.html', 'SEE-THIS'); | |
127 | |
128 my %cframe = ( | |
129 2 => \&syn_reply, | |
130 3 => \&rst_stream, | |
131 4 => \&settings, | |
132 6 => \&ping, | |
133 7 => \&goaway, | |
134 9 => \&window_update | |
135 ); | |
136 | |
137 ############################################################################### | |
138 | |
139 # PING | |
140 | |
141 my $sess = new_session(); | |
142 spdy_ping($sess, 0x12345678); | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
143 my $frames = spdy_read($sess, all => [{ type => 'PING' }]); |
374 | 144 |
145 my ($frame) = grep { $_->{type} eq "PING" } @$frames; | |
146 ok($frame, 'PING frame'); | |
147 is($frame->{value}, 0x12345678, 'PING payload'); | |
148 | |
149 # GET | |
150 | |
151 $sess = new_session(); | |
152 my $sid1 = spdy_stream($sess, { path => '/s' }); | |
153 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
154 | |
155 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | |
156 ok($frame, 'SYN_REPLAY frame'); | |
157 is($frame->{sid}, $sid1, 'SYN_REPLAY stream'); | |
158 is($frame->{headers}->{':status'}, 200, 'SYN_REPLAY status'); | |
159 is($frame->{headers}->{'x-header'}, 'X-Foo', 'SYN_REPLAY header'); | |
160 | |
161 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
162 ok($frame, 'DATA frame'); | |
163 is($frame->{length}, length 'body', 'DATA length'); | |
164 is($frame->{data}, 'body', 'DATA payload'); | |
165 | |
166 # GET in new SPDY stream in same session | |
167 | |
168 my $sid2 = spdy_stream($sess, { path => '/s' }); | |
169 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 1 }]); | |
170 | |
171 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | |
172 is($frame->{sid}, $sid2, 'SYN_REPLAY stream 2'); | |
173 is($frame->{headers}->{':status'}, 200, 'SYN_REPLAY status 2'); | |
174 is($frame->{headers}->{'x-header'}, 'X-Foo', 'SYN_REPLAY header 2'); | |
175 | |
176 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
177 ok($frame, 'DATA frame 2'); | |
178 is($frame->{sid}, $sid2, 'SYN_REPLAY stream 2'); | |
179 is($frame->{length}, length 'body', 'DATA length 2'); | |
180 is($frame->{data}, 'body', 'DATA payload 2'); | |
181 | |
182 # HEAD | |
183 | |
184 $sess = new_session(); | |
185 $sid1 = spdy_stream($sess, { path => '/s', method => 'HEAD' }); | |
186 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
187 | |
188 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | |
189 is($frame->{sid}, $sid1, 'SYN_REPLAY stream HEAD'); | |
190 is($frame->{headers}->{':status'}, 200, 'SYN_REPLAY status HEAD'); | |
191 is($frame->{headers}->{'x-header'}, 'X-Foo', 'SYN_REPLAY header HEAD'); | |
192 | |
193 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
194 is($frame, undef, 'HEAD no body'); | |
195 | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
196 # GET with PROXY protocol |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
197 |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
198 my $proxy = 'PROXY TCP4 192.0.2.1 192.0.2.2 1234 5678' . CRLF; |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
199 $sess = new_session(8082, proxy => $proxy); |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
200 $sid1 = spdy_stream($sess, { path => '/pp' }); |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
201 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
202 |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
203 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
204 ok($frame, 'PROXY SYN_REPLAY frame'); |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
205 is($frame->{headers}->{'x-pp'}, '192.0.2.1', 'PROXY remote addr'); |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
206 |
374 | 207 # request header |
208 | |
209 $sess = new_session(); | |
210 $sid1 = spdy_stream($sess, { path => '/t1.html', | |
211 headers => { "range" => "bytes=10-19" } | |
212 }); | |
213 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
214 | |
215 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | |
216 is($frame->{headers}->{':status'}, 206, 'SYN_REPLAY status range'); | |
217 | |
218 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
219 is($frame->{length}, 10, 'DATA length range'); | |
220 is($frame->{data}, '002XXXX000', 'DATA payload range'); | |
221 | |
442
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
222 # request header with multiple values |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
223 |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
224 $sess = new_session(); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
225 $sid1 = spdy_stream($sess, { path => '/cookie', |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
226 headers => { "cookie" => "val1\0val2" } |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
227 }); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
228 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
229 ok(grep ({ $_->{type} eq "SYN_REPLY" } @$frames), |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
230 'multiple request header values'); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
231 |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
232 # request header with multiple values proxied to http backend |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
233 |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
234 $sess = new_session(); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
235 $sid1 = spdy_stream($sess, { path => '/proxy/cookie', |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
236 headers => { "cookie" => "val1\0val2" } |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
237 }); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
238 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
239 |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
240 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
241 is($frame->{headers}->{'x-cookie'}, 'val1; val2', |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
242 'multiple request header values - proxied'); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
243 |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
244 # response header with multiple values |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
245 |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
246 $sess = new_session(); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
247 $sid1 = spdy_stream($sess, { path => '/set-cookie' }); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
248 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
249 |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
250 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
251 is($frame->{headers}->{'set-cookie'}, "val1\0val2", |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
252 'response header with multiple values'); |
cc4697d6bd16
Tests: added SPDY tests for header field with multiple values.
Sergey Kandaurov <pluknet@nginx.com>
parents:
429
diff
changeset
|
253 |
487
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
254 # response header with multiple values - no empty values inside |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
255 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
256 $sess = new_session(); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
257 $sid1 = spdy_stream($sess, { path => '/header/inside' }); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
258 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
259 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
260 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
261 is($frame->{headers}->{'x-foo'}, "val1\0val2", 'no empty header value inside'); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
262 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
263 $sid1 = spdy_stream($sess, { path => '/header/first' }); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
264 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
265 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
266 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
267 is($frame->{headers}->{'x-foo'}, "val1\0val2", 'no empty header value first'); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
268 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
269 $sid1 = spdy_stream($sess, { path => '/header/last' }); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
270 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
271 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
272 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
273 is($frame->{headers}->{'x-foo'}, "val1\0val2", 'no empty header value last'); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
274 |
374 | 275 # $spdy |
276 | |
277 $sess = new_session(); | |
278 $sid1 = spdy_stream($sess, { path => '/spdy' }); | |
279 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
280 | |
281 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
282 is($frame->{data}, '3.1', 'spdy variable'); | |
283 | |
284 # spdy_chunk_size=1 | |
285 | |
286 $sess = new_session(); | |
287 $sid1 = spdy_stream($sess, { path => '/chunk_size' }); | |
288 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
289 | |
290 my @data = grep { $_->{type} eq "DATA" } @$frames; | |
291 is(@data, 4, 'chunk_size body chunks'); | |
292 is($data[0]->{data}, 'b', 'chunk_size body 1'); | |
293 is($data[1]->{data}, 'o', 'chunk_size body 2'); | |
294 is($data[2]->{data}, 'd', 'chunk_size body 3'); | |
295 is($data[3]->{data}, 'y', 'chunk_size body 4'); | |
296 | |
297 # redirect | |
298 | |
299 $sess = new_session(); | |
300 $sid1 = spdy_stream($sess, { path => '/redirect' }); | |
301 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
302 | |
303 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | |
304 is($frame->{headers}->{':status'}, 405, 'SYN_REPLAY status with redirect'); | |
305 | |
306 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
307 ok($frame, 'DATA frame with redirect'); | |
308 is($frame->{data}, 'body', 'DATA payload with redirect'); | |
309 | |
428
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
310 # SYN_REPLY could be received with fin, followed by DATA |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
311 |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
312 $sess = new_session(); |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
313 $sid1 = spdy_stream($sess, { path => '/proxy/t2.html', method => 'HEAD' }); |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
314 |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
315 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
316 push @$frames, $_ for @{spdy_read($sess, all => [{ sid => $sid1 }])}; |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
317 ok(!grep ({ $_->{type} eq "DATA" } @$frames), 'proxy cache HEAD - no body'); |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
318 |
374 | 319 # ensure that HEAD-like requests, i.e., without response body, do not lead to |
320 # client connection close due to cache filling up with upstream response body | |
321 | |
322 $sid2 = spdy_stream($sess, { path => '/' }); | |
443
d1c4b0d15484
Tests: fixed SPDY test for premature client connection close.
Sergey Kandaurov <pluknet@nginx.com>
parents:
442
diff
changeset
|
323 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 1 }]); |
374 | 324 ok(grep ({ $_->{type} eq "SYN_REPLY" } @$frames), 'proxy cache headers only'); |
325 | |
428
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
326 # HEAD on empty cache with proxy_buffering off |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
327 |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
328 $sess = new_session(); |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
329 $sid1 = spdy_stream($sess, |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
330 { path => '/proxy_buffering_off/t2.html?1', method => 'HEAD' }); |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
331 |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
332 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
333 push @$frames, $_ for @{spdy_read($sess, all => [{ sid => $sid1 }])}; |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
334 ok(!grep ({ $_->{type} eq "DATA" } @$frames), |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
335 'proxy cache HEAD buffering off - no body'); |
e95c3340d94a
Tests: more SPDY tests for caching HEAD requests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
427
diff
changeset
|
336 |
374 | 337 # simple proxy cache test |
338 | |
339 $sess = new_session(); | |
340 $sid1 = spdy_stream($sess, { path => '/proxy/t2.html' }); | |
341 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
342 | |
343 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | |
344 is($frame->{headers}->{':status'}, '200 OK', 'proxy cache unconditional'); | |
345 | |
346 $sid2 = spdy_stream($sess, { path => '/proxy/t2.html', | |
416
5c25acbc870a
Tests: etags support is present in all supported branches.
Maxim Dounin <mdounin@mdounin.ru>
parents:
397
diff
changeset
|
347 headers => { "if-none-match" => $frame->{headers}->{'etag'} } |
374 | 348 }); |
349 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 1 }]); | |
350 | |
351 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | |
352 is($frame->{headers}->{':status'}, 304, 'proxy cache conditional'); | |
353 | |
354 # request body (uses proxied response) | |
355 | |
356 $sess = new_session(); | |
357 $sid1 = spdy_stream($sess, { path => '/proxy/t2.html', body => 'TEST' }); | |
358 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
359 | |
360 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | |
361 is($frame->{headers}->{'x-body'}, 'TEST', 'request body'); | |
362 | |
363 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
364 is($frame->{length}, length 'SEE-THIS', 'proxied response length'); | |
365 is($frame->{data}, 'SEE-THIS', 'proxied response'); | |
366 | |
367 # WINDOW_UPDATE (client side) | |
368 | |
369 $sess = new_session(); | |
370 $sid1 = spdy_stream($sess, { path => '/t1.html' }); | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
371 $frames = spdy_read($sess, all => [{ sid => $sid1, length => 2**16 }]); |
374 | 372 |
373 @data = grep { $_->{type} eq "DATA" } @$frames; | |
374 my $sum = eval join '+', map { $_->{length} } @data; | |
375 is($sum, 2**16, 'iws - stream blocked on initial window size'); | |
376 | |
377 spdy_ping($sess, 0xf00ff00f); | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
378 $frames = spdy_read($sess, all => [{ type => 'PING' }]); |
374 | 379 |
380 ($frame) = grep { $_->{type} eq "PING" } @$frames; | |
381 ok($frame, 'iws - PING not blocked'); | |
382 | |
383 spdy_window($sess, 2**16, $sid1); | |
384 $frames = spdy_read($sess); | |
385 is(@$frames, 0, 'iws - updated stream window'); | |
386 | |
387 spdy_window($sess, 2**16); | |
388 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
389 | |
390 @data = grep { $_->{type} eq "DATA" } @$frames; | |
391 $sum = eval join '+', map { $_->{length} } @data; | |
392 is($sum, 80, 'iws - updated connection window'); | |
393 | |
394 # SETTINGS (initial window size, client side) | |
395 | |
396 $sess = new_session(); | |
397 spdy_settings($sess, 7 => 2**17); | |
398 spdy_window($sess, 2**17); | |
399 | |
400 $sid1 = spdy_stream($sess, { path => '/t1.html' }); | |
401 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
402 | |
403 @data = grep { $_->{type} eq "DATA" } @$frames; | |
404 $sum = eval join '+', map { $_->{length} } @data; | |
405 is($sum, 2**16 + 80, 'increased initial window size'); | |
406 | |
407 # probe for negative available space in a flow control window | |
408 | |
409 $sess = new_session(); | |
410 $sid1 = spdy_stream($sess, { path => '/t1.html' }); | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
411 spdy_read($sess, all => [{ sid => $sid1, length => 2**16 }]); |
374 | 412 |
413 spdy_window($sess, 1); | |
414 spdy_settings($sess, 7 => 42); | |
415 spdy_window($sess, 1024, $sid1); | |
416 | |
417 $frames = spdy_read($sess); | |
418 is(@$frames, 0, 'negative window - no data'); | |
419 | |
420 spdy_window($sess, 2**16 - 42 - 1024, $sid1); | |
421 $frames = spdy_read($sess); | |
422 is(@$frames, 0, 'zero window - no data'); | |
423 | |
424 spdy_window($sess, 1, $sid1); | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
425 $frames = spdy_read($sess, all => [{ sid => $sid1, length => 1 }]); |
374 | 426 is(@$frames, 1, 'positive window - data'); |
427 is(@$frames[0]->{length}, 1, 'positive window - data length'); | |
428 | |
429 # stream multiplexing | |
430 | |
431 $sess = new_session(); | |
432 $sid1 = spdy_stream($sess, { path => '/t1.html' }); | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
433 $frames = spdy_read($sess, all => [{ sid => $sid1, length => 2**16 }]); |
374 | 434 |
435 @data = grep { $_->{type} eq "DATA" } @$frames; | |
436 $sum = eval join '+', map { $_->{length} } @data; | |
437 is($sum, 2**16, 'multiple - stream1 data'); | |
438 | |
439 $sid2 = spdy_stream($sess, { path => '/t1.html' }); | |
440 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 0 }]); | |
441 | |
442 @data = grep { $_->{type} eq "DATA" } @$frames; | |
443 is(@data, 0, 'multiple - stream2 no data'); | |
444 | |
445 spdy_window($sess, 2**17, $sid1); | |
446 spdy_window($sess, 2**17, $sid2); | |
447 spdy_window($sess, 2**17); | |
448 | |
449 $frames = spdy_read($sess, all => [ | |
450 { sid => $sid1, fin => 1 }, | |
451 { sid => $sid2, fin => 1 } | |
452 ]); | |
453 | |
454 @data = grep { $_->{type} eq "DATA" && $_->{sid} == $sid1 } @$frames; | |
455 $sum = eval join '+', map { $_->{length} } @data; | |
456 is($sum, 80, 'multiple - stream1 remain data'); | |
457 | |
458 @data = grep { $_->{type} eq "DATA" && $_->{sid} == $sid2 } @$frames; | |
459 $sum = eval join '+', map { $_->{length} } @data; | |
460 is($sum, 2**16 + 80, 'multiple - stream2 full data'); | |
461 | |
462 # request priority parsing in $spdy_request_priority | |
463 | |
464 $sess = new_session(); | |
465 $sid1 = spdy_stream($sess, { path => '/prio', prio => 0 }); | |
466 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
467 | |
468 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
469 is($frame->{data}, 0, 'priority 0'); | |
470 | |
471 $sid1 = spdy_stream($sess, { path => '/prio', prio => 1 }); | |
472 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
473 | |
474 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
475 is($frame->{data}, 1, 'priority 1'); | |
476 | |
477 $sid1 = spdy_stream($sess, { path => '/prio', prio => 7 }); | |
478 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
479 | |
480 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
481 is($frame->{data}, 7, 'priority 7'); | |
482 | |
483 # stream muliplexing + priority | |
484 | |
485 $sess = new_session(); | |
486 $sid1 = spdy_stream($sess, { path => '/t1.html', prio => 7 }); | |
529
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
487 spdy_read($sess, all => [{ sid => $sid1, length => 2**16 }]); |
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
488 |
374 | 489 $sid2 = spdy_stream($sess, { path => '/t2.html', prio => 0 }); |
529
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
490 spdy_read($sess, all => [{ sid => $sid2, fin => 0 }]); |
374 | 491 |
492 spdy_window($sess, 2**17, $sid1); | |
493 spdy_window($sess, 2**17, $sid2); | |
494 spdy_window($sess, 2**17); | |
495 | |
496 $frames = spdy_read($sess, all => [ | |
497 { sid => $sid1, fin => 1 }, | |
498 { sid => $sid2, fin => 1 } | |
499 ]); | |
500 | |
501 @data = grep { $_->{type} eq "DATA" } @$frames; | |
502 is(join (' ', map { $_->{sid} } @data), "$sid2 $sid1", 'multiple priority 1'); | |
503 | |
504 # and vice versa | |
505 | |
506 $sess = new_session(); | |
507 $sid1 = spdy_stream($sess, { path => '/t1.html', prio => 0 }); | |
529
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
508 spdy_read($sess, all => [{ sid => $sid1, length => 2**16 }]); |
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
509 |
374 | 510 $sid2 = spdy_stream($sess, { path => '/t2.html', prio => 7 }); |
529
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
511 spdy_read($sess, all => [{ sid => $sid2, fin => 0 }]); |
374 | 512 |
513 spdy_window($sess, 2**17, $sid1); | |
514 spdy_window($sess, 2**17, $sid2); | |
515 spdy_window($sess, 2**17); | |
516 | |
517 $frames = spdy_read($sess, all => [ | |
518 { sid => $sid1, fin => 1 }, | |
519 { sid => $sid2, fin => 1 } | |
520 ]); | |
521 | |
522 @data = grep { $_->{type} eq "DATA" } @$frames; | |
523 is(join (' ', map { $_->{sid} } @data), "$sid1 $sid2", 'multiple priority 2'); | |
524 | |
525 # limit_conn | |
526 | |
527 $sess = new_session(); | |
528 spdy_settings($sess, 7 => 1); | |
529
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
529 |
374 | 530 $sid1 = spdy_stream($sess, { path => '/t3.html' }); |
529
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
531 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 0 }]); |
374 | 532 |
533 ($frame) = grep { $_->{type} eq "SYN_REPLY" && $_->{sid} == $sid1 } @$frames; | |
534 is($frame->{headers}->{':status'}, 200, 'conn_limit 1'); | |
535 | |
529
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
536 $sid2 = spdy_stream($sess, { path => '/t3.html' }); |
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
537 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 0 }]); |
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
538 |
374 | 539 ($frame) = grep { $_->{type} eq "SYN_REPLY" && $_->{sid} == $sid2 } @$frames; |
540 is($frame->{headers}->{':status'}, 503, 'conn_limit 2'); | |
541 | |
470
00275fa9091c
Tests: fixed SPDY test with limit_conn.
Sergey Kandaurov <pluknet@nginx.com>
parents:
443
diff
changeset
|
542 spdy_settings($sess, 7 => 2**16); |
00275fa9091c
Tests: fixed SPDY test with limit_conn.
Sergey Kandaurov <pluknet@nginx.com>
parents:
443
diff
changeset
|
543 |
00275fa9091c
Tests: fixed SPDY test with limit_conn.
Sergey Kandaurov <pluknet@nginx.com>
parents:
443
diff
changeset
|
544 spdy_read($sess, all => [ |
00275fa9091c
Tests: fixed SPDY test with limit_conn.
Sergey Kandaurov <pluknet@nginx.com>
parents:
443
diff
changeset
|
545 { sid => $sid1, fin => 1 }, |
00275fa9091c
Tests: fixed SPDY test with limit_conn.
Sergey Kandaurov <pluknet@nginx.com>
parents:
443
diff
changeset
|
546 { sid => $sid2, fin => 1 } |
00275fa9091c
Tests: fixed SPDY test with limit_conn.
Sergey Kandaurov <pluknet@nginx.com>
parents:
443
diff
changeset
|
547 ]); |
00275fa9091c
Tests: fixed SPDY test with limit_conn.
Sergey Kandaurov <pluknet@nginx.com>
parents:
443
diff
changeset
|
548 |
374 | 549 # limit_conn + client's RST_STREAM |
550 | |
551 $sess = new_session(); | |
552 spdy_settings($sess, 7 => 1); | |
529
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
553 |
374 | 554 $sid1 = spdy_stream($sess, { path => '/t3.html' }); |
529
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
555 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 0 }]); |
374 | 556 spdy_rst($sess, $sid1, 5); |
557 | |
558 ($frame) = grep { $_->{type} eq "SYN_REPLY" && $_->{sid} == $sid1 } @$frames; | |
559 is($frame->{headers}->{':status'}, 200, 'RST_STREAM 1'); | |
560 | |
529
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
561 $sid2 = spdy_stream($sess, { path => '/t3.html' }); |
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
562 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 0 }]); |
42810c40ebb8
Tests: removed races from SPDY tests with consecutive streams.
Sergey Kandaurov <pluknet@nginx.com>
parents:
503
diff
changeset
|
563 |
374 | 564 ($frame) = grep { $_->{type} eq "SYN_REPLY" && $_->{sid} == $sid2 } @$frames; |
565 is($frame->{headers}->{':status'}, 200, 'RST_STREAM 2'); | |
566 | |
567 # GOAWAY on SYN_STREAM with even StreamID | |
568 | |
569 TODO: { | |
570 local $TODO = 'not yet'; | |
571 | |
572 $sess = new_session(); | |
573 spdy_stream($sess, { path => '/s' }, 2); | |
574 $frames = spdy_read($sess); | |
575 | |
576 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | |
577 ok($frame, 'even stream - GOAWAY frame'); | |
578 is($frame->{code}, 1, 'even stream - error code'); | |
579 is($frame->{sid}, 0, 'even stream - last used stream'); | |
580 | |
581 } | |
582 | |
583 # GOAWAY on SYN_STREAM with backward StreamID | |
584 | |
585 TODO: { | |
586 local $TODO = 'not yet'; | |
587 | |
588 $sess = new_session(); | |
589 $sid1 = spdy_stream($sess, { path => '/s' }, 3); | |
590 spdy_read($sess); | |
591 | |
592 $sid2 = spdy_stream($sess, { path => '/s' }, 1); | |
593 $frames = spdy_read($sess); | |
594 | |
595 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | |
596 ok($frame, 'backward stream - GOAWAY frame'); | |
597 is($frame->{code}, 1, 'backward stream - error code'); | |
598 is($frame->{sid}, $sid1, 'backward stream - last used stream'); | |
599 | |
600 } | |
601 | |
602 # RST_STREAM on the second SYN_STREAM with same StreamID | |
603 | |
604 TODO: { | |
605 local $TODO = 'not yet'; | |
606 | |
607 $sess = new_session(); | |
608 $sid1 = spdy_stream($sess, { path => '/s' }, 3); | |
609 spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
610 $sid2 = spdy_stream($sess, { path => '/s' }, 3); | |
611 $frames = spdy_read($sess); | |
612 | |
613 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; | |
614 ok($frame, 'dup stream - RST_STREAM frame'); | |
615 is($frame->{code}, 1, 'dup stream - error code'); | |
616 is($frame->{sid}, $sid1, 'dup stream - stream'); | |
617 | |
618 } | |
619 | |
620 # awkward protocol version | |
621 | |
622 $sess = new_session(); | |
623 $sid1 = spdy_stream($sess, { path => '/s', version => 'HTTP/1.10' }); | |
624 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
625 | |
626 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | |
627 is($frame->{headers}->{':status'}, 200, 'awkward version'); | |
628 | |
629 # missing mandatory request header | |
630 | |
631 $sess = new_session(); | |
632 $sid1 = spdy_stream($sess, { path => '/s', version => '' }); | |
633 $frames = spdy_read($sess, all => [{ sid => $sid1, fin => 1 }]); | |
634 | |
635 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; | |
636 is($frame->{headers}->{':status'}, 400, 'incomplete headers'); | |
637 | |
638 # GOAWAY before closing a connection by server | |
639 | |
640 $t->stop(); | |
641 | |
642 TODO: { | |
643 local $TODO = 'not yet'; | |
644 | |
645 $frames = spdy_read($sess); | |
646 | |
647 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | |
648 ok($frame, 'GOAWAY on connection close'); | |
649 | |
650 } | |
651 | |
652 ############################################################################### | |
653 | |
654 sub spdy_ping { | |
655 my ($sess, $payload) = @_; | |
656 | |
657 raw_write($sess->{socket}, pack("N3", 0x80030006, 0x4, $payload)); | |
658 } | |
659 | |
660 sub spdy_rst { | |
661 my ($sess, $sid, $error) = @_; | |
662 | |
663 raw_write($sess->{socket}, pack("N4", 0x80030003, 0x8, $sid, $error)); | |
664 } | |
665 | |
666 sub spdy_window { | |
667 my ($sess, $win, $stream) = @_; | |
668 | |
669 $stream = 0 unless defined $stream; | |
670 raw_write($sess->{socket}, pack("N4", 0x80030009, 8, $stream, $win)); | |
671 } | |
672 | |
673 sub spdy_settings { | |
674 my ($sess, %extra) = @_; | |
675 | |
676 my $cnt = keys %extra; | |
677 my $len = 4 + 8 * $cnt; | |
678 | |
679 my $buf = pack "N3", 0x80030004, $len, $cnt; | |
680 $buf .= join '', map { pack "N2", $_, $extra{$_} } keys %extra; | |
681 raw_write($sess->{socket}, $buf); | |
682 } | |
683 | |
684 sub spdy_read { | |
685 my ($sess, %extra) = @_; | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
686 my ($length, @got); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
687 my $s = $sess->{socket}; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
688 my $buf = ''; |
374 | 689 |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
690 eval { |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
691 local $SIG{ALRM} = sub { die "timeout\n" }; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
692 local $SIG{PIPE} = sub { die "sigpipe\n" }; |
374 | 693 again: |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
694 alarm(1); |
374 | 695 |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
696 $buf = raw_read($s, $buf, 8); |
379
f42de3a9fd74
Tests: avoid uninitialized warnings in spdy.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
377
diff
changeset
|
697 |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
698 my $type = unpack("B", $buf); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
699 $length = 8 + hex unpack("x5 H6", $buf); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
700 $buf = raw_read($s, $buf, $length); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
701 |
374 | 702 if ($type == 0) { |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
703 push @got, dframe($buf); |
374 | 704 |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
705 } else { |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
706 my $ctype = unpack("x2 n", $buf); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
707 push @got, $cframe{$ctype}($sess, $buf); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
708 } |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
709 $buf = substr($buf, $length); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
710 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
711 goto again if test_fin($got[-1], $extra{all}); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
712 alarm(0); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
713 }; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
714 alarm(0); |
374 | 715 return \@got; |
716 } | |
717 | |
718 sub test_fin { | |
719 my ($frame, $all) = @_; | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
720 my @test = @{$all}; |
374 | 721 |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
722 # wait for the specified DATA length |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
723 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
724 for (@test) { |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
725 if ($_->{length} && $frame->{type} eq 'DATA') { |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
726 # check also for StreamID if needed |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
727 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
728 if (!$_->{sid} || $_->{sid} == $frame->{sid}) { |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
729 $_->{length} -= $frame->{length}; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
730 } |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
731 } |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
732 } |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
733 @test = grep { !(defined $_->{length} && $_->{length} == 0) } @test; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
734 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
735 # wait for the fin flag |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
736 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
737 @test = grep { !(defined $_->{fin} |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
738 && $_->{sid} == $frame->{sid} && $_->{fin} == $frame->{fin}) |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
739 } @test if defined $frame->{fin}; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
740 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
741 # wait for the specified frame |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
742 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
743 @test = grep { !($_->{type} && $_->{type} eq $frame->{type}) } @test; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
744 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
745 @{$all} = @test; |
374 | 746 } |
747 | |
748 sub dframe { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
749 my ($buf) = @_; |
374 | 750 my %frame; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
751 my $skip = 0; |
374 | 752 |
753 my $stream = unpack "\@$skip B32", $buf; $skip += 4; | |
754 substr($stream, 0, 1) = 0; | |
755 $stream = unpack("N", pack("B32", $stream)); | |
756 $frame{sid} = $stream; | |
757 | |
758 my $flags = unpack "\@$skip B8", $buf; $skip += 1; | |
759 $frame{fin} = substr($flags, 7, 1); | |
760 | |
761 my $length = hex (unpack "\@$skip H6", $buf); $skip += 3; | |
762 $frame{length} = $length; | |
763 | |
764 $frame{data} = substr($buf, $skip, $length); | |
765 $frame{type} = "DATA"; | |
766 return \%frame; | |
767 } | |
768 | |
769 sub spdy_stream { | |
770 my ($ctx, $uri, $stream) = @_; | |
771 my ($input, $output, $buf); | |
772 my ($d, $status); | |
773 | |
774 my $host = $uri->{host} || '127.0.0.1:8080'; | |
775 my $method = $uri->{method} || 'GET'; | |
776 my $headers = $uri->{headers} || {}; | |
777 my $body = $uri->{body}; | |
778 my $prio = defined $uri->{prio} ? $uri->{prio} : 4; | |
779 my $version = defined $uri->{version} ? $uri->{version} : "HTTP/1.1"; | |
780 | |
781 if ($stream) { | |
782 $ctx->{last_stream} = $stream; | |
783 } else { | |
784 $ctx->{last_stream} += 2; | |
785 } | |
786 | |
787 $buf = pack("NC", 0x80030001, not $body); | |
788 $buf .= pack("xxx"); # Length stub | |
789 $buf .= pack("N", $ctx->{last_stream}); # Stream-ID | |
790 $buf .= pack("N", 0); # Assoc. Stream-ID | |
791 $buf .= pack("n", $prio << 13); | |
792 | |
793 my $ent = 4 + keys %{$headers}; | |
794 $ent++ if $body; | |
795 $ent++ if $version; | |
796 | |
797 $input = pack("N", $ent); | |
798 $input .= hpack(":host", $host); | |
799 $input .= hpack(":method", $method); | |
800 $input .= hpack(":path", $uri->{path}); | |
801 $input .= hpack(":scheme", "http"); | |
802 if ($version) { | |
803 $input .= hpack(":version", $version); | |
804 } | |
805 if ($body) { | |
806 $input .= hpack("content-length", length $body); | |
807 } | |
808 $input .= join '', map { hpack($_, $headers->{$_}) } keys %{$headers}; | |
809 | |
810 $d = $ctx->{zlib}->{d}; | |
811 $status = $d->deflate($input => \my $start); | |
812 $status == Compress::Raw::Zlib->Z_OK or fail "deflate failed"; | |
813 $status = $d->flush(\my $tail => Compress::Raw::Zlib->Z_SYNC_FLUSH); | |
814 $status == Compress::Raw::Zlib->Z_OK or fail "flush failed"; | |
815 $output = $start . $tail; | |
816 | |
426
7cb6af00afdd
Tests: fixed SPDY tests with large header length.
Sergey Kandaurov <pluknet@nginx.com>
parents:
425
diff
changeset
|
817 # set length, attach headers and optional body |
7cb6af00afdd
Tests: fixed SPDY tests with large header length.
Sergey Kandaurov <pluknet@nginx.com>
parents:
425
diff
changeset
|
818 |
7cb6af00afdd
Tests: fixed SPDY tests with large header length.
Sergey Kandaurov <pluknet@nginx.com>
parents:
425
diff
changeset
|
819 $buf |= pack "x4N", length($output) + 10; |
374 | 820 $buf .= $output; |
821 | |
822 if (defined $body) { | |
823 $buf .= pack "NCxn", $ctx->{last_stream}, 0x01, length $body; | |
824 $buf .= $body; | |
825 } | |
826 | |
827 raw_write($ctx->{socket}, $buf); | |
828 return $ctx->{last_stream}; | |
829 } | |
830 | |
831 sub syn_reply { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
832 my ($ctx, $buf) = @_; |
374 | 833 my ($i, $status); |
834 my %payload; | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
835 my $skip = 4; |
374 | 836 |
837 my $flags = unpack "\@$skip B8", $buf; $skip += 1; | |
838 $payload{fin} = substr($flags, 7, 1); | |
839 | |
840 my $length = hex unpack "\@$skip H6", $buf; $skip += 3; | |
841 $payload{length} = $length; | |
842 $payload{type} = 'SYN_REPLY'; | |
843 | |
844 my $stream = unpack "\@$skip B32", $buf; $skip += 4; | |
845 substr($stream, 0, 1) = 0; | |
846 $stream = unpack("N", pack("B32", $stream)); | |
847 $payload{sid} = $stream; | |
848 | |
849 my $input = substr($buf, $skip, $length - 4); | |
850 $i = $ctx->{zlib}->{i}; | |
851 | |
852 $status = $i->inflate($input => \my $out); | |
853 fail "Failed: $status" unless $status == Compress::Raw::Zlib->Z_OK; | |
854 $payload{headers} = hunpack($out); | |
855 return \%payload; | |
856 } | |
857 | |
858 sub rst_stream { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
859 my ($ctx, $buf) = @_; |
374 | 860 my %payload; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
861 my $skip = 5; |
374 | 862 |
863 $payload{length} = hex(unpack "\@$skip H6", $buf); $skip += 3; | |
864 $payload{type} = 'RST_STREAM'; | |
865 $payload{sid} = unpack "\@$skip N", $buf; $skip += 4; | |
866 $payload{code} = unpack "\@$skip N", $buf; | |
867 return \%payload; | |
868 } | |
869 | |
870 sub settings { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
871 my ($ctx, $buf) = @_; |
374 | 872 my %payload; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
873 my $skip = 4; |
374 | 874 |
875 $payload{flags} = unpack "\@$skip H", $buf; $skip += 1; | |
876 $payload{length} = hex(unpack "\@$skip H6", $buf); $skip += 3; | |
877 $payload{type} = 'SETTINGS'; | |
878 | |
879 my $nent = unpack "\@$skip N", $buf; $skip += 4; | |
880 for (1 .. $nent) { | |
881 my $flags = hex unpack "\@$skip H2", $buf; $skip += 1; | |
882 my $id = hex unpack "\@$skip H6", $buf; $skip += 3; | |
883 $payload{$id}{flags} = $flags; | |
884 $payload{$id}{value} = unpack "\@$skip N", $buf; $skip += 4; | |
885 } | |
886 return \%payload; | |
887 } | |
888 | |
889 sub ping { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
890 my ($ctx, $buf) = @_; |
374 | 891 my %payload; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
892 my $skip = 5; |
374 | 893 |
894 $payload{length} = hex(unpack "\@$skip H6", $buf); $skip += 3; | |
895 $payload{type} = 'PING'; | |
896 $payload{value} = unpack "\@$skip N", $buf; | |
897 return \%payload; | |
898 } | |
899 | |
900 sub goaway { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
901 my ($ctx, $buf) = @_; |
374 | 902 my %payload; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
903 my $skip = 5; |
374 | 904 |
905 $payload{length} = hex unpack "\@$skip H6", $buf; $skip += 3; | |
906 $payload{type} = 'GOAWAY'; | |
907 $payload{sid} = unpack "\@$skip N", $buf; $skip += 4; | |
908 $payload{code} = unpack "\@$skip N", $buf; | |
909 return \%payload; | |
910 } | |
911 | |
912 sub window_update { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
913 my ($ctx, $buf) = @_; |
374 | 914 my %payload; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
915 my $skip = 5; |
374 | 916 |
917 $payload{length} = hex(unpack "\@$skip H6", $buf); $skip += 3; | |
918 $payload{type} = 'WINDOW_UPDATE'; | |
919 | |
920 my $stream = unpack "\@$skip B32", $buf; $skip += 4; | |
921 substr($stream, 0, 1) = 0; | |
922 $stream = unpack("N", pack("B32", $stream)); | |
923 $payload{sid} = $stream; | |
924 | |
925 my $value = unpack "\@$skip B32", $buf; | |
926 substr($value, 0, 1) = 0; | |
927 $payload{wdelta} = unpack("N", pack("B32", $value)); | |
928 return \%payload; | |
929 } | |
930 | |
931 sub hpack { | |
932 my ($name, $value) = @_; | |
933 | |
934 pack("N", length($name)) . $name . pack("N", length($value)) . $value; | |
935 } | |
936 | |
937 sub hunpack { | |
938 my ($data) = @_; | |
939 my %headers; | |
940 my $skip = 0; | |
941 | |
942 my $nent = unpack "\@$skip N", $data; $skip += 4; | |
943 for (1 .. $nent) { | |
944 my $len = unpack("\@$skip N", $data); $skip += 4; | |
945 my $name = unpack("\@$skip A$len", $data); $skip += $len; | |
946 | |
947 $len = unpack("\@$skip N", $data); $skip += 4; | |
948 my $value = unpack("\@$skip A$len", $data); $skip += $len; | |
486
c2c1eb6d7a76
Tests: worked around a bug in perl unpack.
Sergey Kandaurov <pluknet@nginx.com>
parents:
470
diff
changeset
|
949 $value .= "\0" x ($len - length $value); |
374 | 950 |
951 $headers{$name} = $value; | |
952 } | |
953 return \%headers; | |
954 } | |
955 | |
956 sub raw_read { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
957 my ($s, $buf, $len) = @_; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
958 my $got = ''; |
374 | 959 |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
960 while (length($buf) < $len) { |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
961 $s->sysread($got, $len - length($buf)) or die; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
962 log_in($got); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
963 $buf .= $got; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
964 } |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
965 return $buf; |
374 | 966 } |
967 | |
968 sub raw_write { | |
969 my ($s, $message) = @_; | |
970 | |
971 local $SIG{PIPE} = 'IGNORE'; | |
972 | |
973 while (IO::Select->new($s)->can_write(0.4)) { | |
974 log_out($message); | |
975 my $n = $s->syswrite($message); | |
976 last unless $n; | |
977 $message = substr($message, $n); | |
978 last unless length $message; | |
979 } | |
980 } | |
981 | |
982 sub new_session { | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
983 my ($port, %extra) = @_; |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
984 my ($d, $i, $status, $s); |
374 | 985 |
986 ($d, $status) = Compress::Raw::Zlib::Deflate->new( | |
987 -WindowBits => 12, | |
988 -Dictionary => dictionary(), | |
989 -Level => Compress::Raw::Zlib->Z_NO_COMPRESSION | |
990 ); | |
991 fail "Zlib failure: $status" unless $d; | |
992 | |
993 ($i, $status) = Compress::Raw::Zlib::Inflate->new( | |
994 -WindowBits => Compress::Raw::Zlib->WANT_GZIP_OR_ZLIB, | |
995 -Dictionary => dictionary() | |
996 ); | |
997 fail "Zlib failure: $status" unless $i; | |
998 | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
999 $s = new_socket($port); |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1000 |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1001 if ($extra{proxy}) { |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1002 raw_write($s, $extra{proxy}); |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1003 } |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1004 |
374 | 1005 return { zlib => { i => $i, d => $d }, |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1006 socket => $s, last_stream => -1 }; |
374 | 1007 } |
1008 | |
1009 sub new_socket { | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1010 my ($port) = @_; |
374 | 1011 my $s; |
1012 | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1013 $port = 8080 unless defined $port; |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1014 |
374 | 1015 eval { |
1016 local $SIG{ALRM} = sub { die "timeout\n" }; | |
1017 local $SIG{PIPE} = sub { die "sigpipe\n" }; | |
1018 alarm(2); | |
1019 $s = IO::Socket::INET->new( | |
1020 Proto => 'tcp', | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1021 PeerAddr => "127.0.0.1:$port", |
374 | 1022 ); |
1023 alarm(0); | |
1024 }; | |
1025 alarm(0); | |
1026 | |
1027 if ($@) { | |
1028 log_in("died: $@"); | |
1029 return undef; | |
1030 } | |
1031 | |
1032 return $s; | |
1033 } | |
1034 | |
1035 sub dictionary { | |
1036 join('', (map pack('N/a*', $_), qw( | |
1037 options | |
1038 head | |
1039 post | |
1040 put | |
1041 delete | |
1042 trace | |
1043 accept | |
1044 accept-charset | |
1045 accept-encoding | |
1046 accept-language | |
1047 accept-ranges | |
1048 age | |
1049 allow | |
1050 authorization | |
1051 cache-control | |
1052 connection | |
1053 content-base | |
1054 content-encoding | |
1055 content-language | |
1056 content-length | |
1057 content-location | |
1058 content-md5 | |
1059 content-range | |
1060 content-type | |
1061 date | |
1062 etag | |
1063 expect | |
1064 expires | |
1065 from | |
1066 host | |
1067 if-match | |
1068 if-modified-since | |
1069 if-none-match | |
1070 if-range | |
1071 if-unmodified-since | |
1072 last-modified | |
1073 location | |
1074 max-forwards | |
1075 pragma | |
1076 proxy-authenticate | |
1077 proxy-authorization | |
1078 range | |
1079 referer | |
1080 retry-after | |
1081 server | |
1082 te | |
1083 trailer | |
1084 transfer-encoding | |
1085 upgrade | |
1086 user-agent | |
1087 vary | |
1088 via | |
1089 warning | |
1090 www-authenticate | |
1091 method | |
1092 get | |
1093 status), "200 OK", | |
1094 qw(version HTTP/1.1 url public set-cookie keep-alive origin)), | |
1095 "100101201202205206300302303304305306307402405406407408409410", | |
1096 "411412413414415416417502504505", | |
1097 "203 Non-Authoritative Information", | |
1098 "204 No Content", | |
1099 "301 Moved Permanently", | |
1100 "400 Bad Request", | |
1101 "401 Unauthorized", | |
1102 "403 Forbidden", | |
1103 "404 Not Found", | |
1104 "500 Internal Server Error", | |
1105 "501 Not Implemented", | |
1106 "503 Service Unavailable", | |
1107 "Jan Feb Mar Apr May Jun Jul Aug Sept Oct Nov Dec", | |
1108 " 00:00:00", | |
1109 " Mon, Tue, Wed, Thu, Fri, Sat, Sun, GMT", | |
1110 "chunked,text/html,image/png,image/jpg,image/gif,", | |
1111 "application/xml,application/xhtml+xml,text/plain,", | |
1112 "text/javascript,public", "privatemax-age=gzip,deflate,", | |
1113 "sdchcharset=utf-8charset=iso-8859-1,utf-,*,enq=0." | |
1114 ); | |
1115 } | |
1116 | |
1117 ############################################################################### | |
487
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1118 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1119 # reply with multiple (also empty) header values |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1120 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1121 sub http_daemon { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1122 my $server = IO::Socket::INET->new( |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1123 Proto => 'tcp', |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1124 LocalHost => '127.0.0.1', |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1125 LocalPort => 8083, |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1126 Listen => 5, |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1127 Reuse => 1 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1128 ) |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1129 or die "Can't create listening socket: $!\n"; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1130 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1131 local $SIG{PIPE} = 'IGNORE'; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1132 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1133 while (my $client = $server->accept()) { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1134 $client->autoflush(1); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1135 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1136 my $headers = ''; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1137 my $uri = ''; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1138 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1139 while (<$client>) { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1140 $headers .= $_; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1141 last if (/^\x0d?\x0a?$/); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1142 } |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1143 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1144 next if $headers eq ''; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1145 $uri = $1 if $headers =~ /^\S+\s+([^ ]+)\s+HTTP/i; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1146 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1147 if ($uri eq '/inside') { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1148 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1149 print $client <<EOF; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1150 HTTP/1.1 200 OK |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1151 Connection: close |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1152 X-Foo: val1 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1153 X-Foo: |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1154 X-Foo: val2 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1155 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1156 EOF |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1157 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1158 } elsif ($uri eq '/first') { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1159 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1160 print $client <<EOF; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1161 HTTP/1.1 200 OK |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1162 Connection: close |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1163 X-Foo: |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1164 X-Foo: val1 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1165 X-Foo: val2 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1166 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1167 EOF |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1168 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1169 } elsif ($uri eq '/last') { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1170 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1171 print $client <<EOF; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1172 HTTP/1.1 200 OK |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1173 Connection: close |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1174 X-Foo: val1 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1175 X-Foo: val2 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1176 X-Foo: |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1177 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1178 EOF |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1179 } |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1180 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1181 } continue { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1182 close $client; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1183 } |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1184 } |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1185 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1186 ############################################################################### |