Mercurial > hg > nginx-tests
annotate spdy.t @ 657:68a95e3195f1
Tests: try_files TODO adjusted.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 20 Aug 2015 20:07:47 +0300 |
parents | 2b43ad56bce0 |
children | 626bc3a0fdaa |
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; | |
639 | 156 ok($frame, 'SYN_REPLY frame'); |
157 is($frame->{sid}, $sid1, 'SYN_REPLY stream'); | |
158 is($frame->{headers}->{':status'}, 200, 'SYN_REPLY status'); | |
159 is($frame->{headers}->{'x-header'}, 'X-Foo', 'SYN_REPLY header'); | |
374 | 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; | |
639 | 172 is($frame->{sid}, $sid2, 'SYN_REPLY stream 2'); |
173 is($frame->{headers}->{':status'}, 200, 'SYN_REPLY status 2'); | |
174 is($frame->{headers}->{'x-header'}, 'X-Foo', 'SYN_REPLY header 2'); | |
374 | 175 |
176 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | |
177 ok($frame, 'DATA frame 2'); | |
639 | 178 is($frame->{sid}, $sid2, 'SYN_REPLY stream 2'); |
374 | 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; | |
639 | 189 is($frame->{sid}, $sid1, 'SYN_REPLY stream HEAD'); |
190 is($frame->{headers}->{':status'}, 200, 'SYN_REPLY status HEAD'); | |
191 is($frame->{headers}->{'x-header'}, 'X-Foo', 'SYN_REPLY header HEAD'); | |
374 | 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; |
639 | 204 ok($frame, 'PROXY SYN_REPLY frame'); |
427
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; | |
639 | 216 is($frame->{headers}->{':status'}, 206, 'SYN_REPLY status range'); |
374 | 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; | |
639 | 304 is($frame->{headers}->{':status'}, 405, 'SYN_REPLY status with redirect'); |
374 | 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 | |
595
6cdfd177319b
Tests: fixed typos and misspellings.
Sergey Kandaurov <pluknet@nginx.com>
parents:
581
diff
changeset
|
483 # stream multiplexing + priority |
374 | 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); | |
581
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
574 $frames = spdy_read($sess, all => [{ type => 'GOAWAY' }]); |
374 | 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); | |
581
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
590 spdy_read($sess, all => [{ type => 'GOAWAY' }]); |
374 | 591 |
592 $sid2 = spdy_stream($sess, { path => '/s' }, 1); | |
581
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
593 $frames = spdy_read($sess, all => [{ type => 'GOAWAY' }]); |
374 | 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); | |
581
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
611 $frames = spdy_read($sess, all => [{ type => 'RST_STREAM' }]); |
374 | 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 | |
581
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
645 $frames = spdy_read($sess, all => [{ type => 'RST_STREAM' }]); |
374 | 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 |
581
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
690 while (1) { |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
691 $buf = raw_read($s, $buf, 8); |
581
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
692 last unless length $buf; |
379
f42de3a9fd74
Tests: avoid uninitialized warnings in spdy.t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
377
diff
changeset
|
693 |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
694 my $type = unpack("B", $buf); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
695 $length = 8 + hex unpack("x5 H6", $buf); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
696 $buf = raw_read($s, $buf, $length); |
581
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
697 last unless length $buf; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
698 |
374 | 699 if ($type == 0) { |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
700 push @got, dframe($buf); |
374 | 701 |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
702 } else { |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
703 my $ctype = unpack("x2 n", $buf); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
704 push @got, $cframe{$ctype}($sess, $buf); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
705 } |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
706 $buf = substr($buf, $length); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
707 |
581
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
708 last unless test_fin($got[-1], $extra{all}); |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
709 }; |
374 | 710 return \@got; |
711 } | |
712 | |
713 sub test_fin { | |
714 my ($frame, $all) = @_; | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
715 my @test = @{$all}; |
374 | 716 |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
717 # wait for the specified DATA length |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
718 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
719 for (@test) { |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
720 if ($_->{length} && $frame->{type} eq 'DATA') { |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
721 # check also for StreamID if needed |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
722 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
723 if (!$_->{sid} || $_->{sid} == $frame->{sid}) { |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
724 $_->{length} -= $frame->{length}; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
725 } |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
726 } |
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 @test = grep { !(defined $_->{length} && $_->{length} == 0) } @test; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
729 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
730 # wait for the fin flag |
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 @test = grep { !(defined $_->{fin} |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
733 && $_->{sid} == $frame->{sid} && $_->{fin} == $frame->{fin}) |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
734 } @test if defined $frame->{fin}; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
735 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
736 # wait for the specified frame |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
737 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
738 @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
|
739 |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
740 @{$all} = @test; |
374 | 741 } |
742 | |
743 sub dframe { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
744 my ($buf) = @_; |
374 | 745 my %frame; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
746 my $skip = 0; |
374 | 747 |
748 my $stream = unpack "\@$skip B32", $buf; $skip += 4; | |
749 substr($stream, 0, 1) = 0; | |
750 $stream = unpack("N", pack("B32", $stream)); | |
751 $frame{sid} = $stream; | |
752 | |
753 my $flags = unpack "\@$skip B8", $buf; $skip += 1; | |
754 $frame{fin} = substr($flags, 7, 1); | |
755 | |
756 my $length = hex (unpack "\@$skip H6", $buf); $skip += 3; | |
757 $frame{length} = $length; | |
758 | |
759 $frame{data} = substr($buf, $skip, $length); | |
760 $frame{type} = "DATA"; | |
761 return \%frame; | |
762 } | |
763 | |
764 sub spdy_stream { | |
765 my ($ctx, $uri, $stream) = @_; | |
766 my ($input, $output, $buf); | |
767 my ($d, $status); | |
768 | |
769 my $host = $uri->{host} || '127.0.0.1:8080'; | |
770 my $method = $uri->{method} || 'GET'; | |
771 my $headers = $uri->{headers} || {}; | |
772 my $body = $uri->{body}; | |
773 my $prio = defined $uri->{prio} ? $uri->{prio} : 4; | |
774 my $version = defined $uri->{version} ? $uri->{version} : "HTTP/1.1"; | |
775 | |
776 if ($stream) { | |
777 $ctx->{last_stream} = $stream; | |
778 } else { | |
779 $ctx->{last_stream} += 2; | |
780 } | |
781 | |
782 $buf = pack("NC", 0x80030001, not $body); | |
783 $buf .= pack("xxx"); # Length stub | |
784 $buf .= pack("N", $ctx->{last_stream}); # Stream-ID | |
785 $buf .= pack("N", 0); # Assoc. Stream-ID | |
786 $buf .= pack("n", $prio << 13); | |
787 | |
788 my $ent = 4 + keys %{$headers}; | |
789 $ent++ if $body; | |
790 $ent++ if $version; | |
791 | |
792 $input = pack("N", $ent); | |
793 $input .= hpack(":host", $host); | |
794 $input .= hpack(":method", $method); | |
795 $input .= hpack(":path", $uri->{path}); | |
796 $input .= hpack(":scheme", "http"); | |
797 if ($version) { | |
798 $input .= hpack(":version", $version); | |
799 } | |
800 if ($body) { | |
801 $input .= hpack("content-length", length $body); | |
802 } | |
803 $input .= join '', map { hpack($_, $headers->{$_}) } keys %{$headers}; | |
804 | |
805 $d = $ctx->{zlib}->{d}; | |
806 $status = $d->deflate($input => \my $start); | |
807 $status == Compress::Raw::Zlib->Z_OK or fail "deflate failed"; | |
808 $status = $d->flush(\my $tail => Compress::Raw::Zlib->Z_SYNC_FLUSH); | |
809 $status == Compress::Raw::Zlib->Z_OK or fail "flush failed"; | |
810 $output = $start . $tail; | |
811 | |
426
7cb6af00afdd
Tests: fixed SPDY tests with large header length.
Sergey Kandaurov <pluknet@nginx.com>
parents:
425
diff
changeset
|
812 # 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
|
813 |
7cb6af00afdd
Tests: fixed SPDY tests with large header length.
Sergey Kandaurov <pluknet@nginx.com>
parents:
425
diff
changeset
|
814 $buf |= pack "x4N", length($output) + 10; |
374 | 815 $buf .= $output; |
816 | |
817 if (defined $body) { | |
818 $buf .= pack "NCxn", $ctx->{last_stream}, 0x01, length $body; | |
819 $buf .= $body; | |
820 } | |
821 | |
822 raw_write($ctx->{socket}, $buf); | |
823 return $ctx->{last_stream}; | |
824 } | |
825 | |
826 sub syn_reply { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
827 my ($ctx, $buf) = @_; |
374 | 828 my ($i, $status); |
829 my %payload; | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
830 my $skip = 4; |
374 | 831 |
832 my $flags = unpack "\@$skip B8", $buf; $skip += 1; | |
833 $payload{fin} = substr($flags, 7, 1); | |
834 | |
835 my $length = hex unpack "\@$skip H6", $buf; $skip += 3; | |
836 $payload{length} = $length; | |
837 $payload{type} = 'SYN_REPLY'; | |
838 | |
839 my $stream = unpack "\@$skip B32", $buf; $skip += 4; | |
840 substr($stream, 0, 1) = 0; | |
841 $stream = unpack("N", pack("B32", $stream)); | |
842 $payload{sid} = $stream; | |
843 | |
844 my $input = substr($buf, $skip, $length - 4); | |
845 $i = $ctx->{zlib}->{i}; | |
846 | |
847 $status = $i->inflate($input => \my $out); | |
848 fail "Failed: $status" unless $status == Compress::Raw::Zlib->Z_OK; | |
849 $payload{headers} = hunpack($out); | |
850 return \%payload; | |
851 } | |
852 | |
853 sub rst_stream { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
854 my ($ctx, $buf) = @_; |
374 | 855 my %payload; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
856 my $skip = 5; |
374 | 857 |
858 $payload{length} = hex(unpack "\@$skip H6", $buf); $skip += 3; | |
859 $payload{type} = 'RST_STREAM'; | |
860 $payload{sid} = unpack "\@$skip N", $buf; $skip += 4; | |
861 $payload{code} = unpack "\@$skip N", $buf; | |
862 return \%payload; | |
863 } | |
864 | |
865 sub settings { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
866 my ($ctx, $buf) = @_; |
374 | 867 my %payload; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
868 my $skip = 4; |
374 | 869 |
870 $payload{flags} = unpack "\@$skip H", $buf; $skip += 1; | |
871 $payload{length} = hex(unpack "\@$skip H6", $buf); $skip += 3; | |
872 $payload{type} = 'SETTINGS'; | |
873 | |
874 my $nent = unpack "\@$skip N", $buf; $skip += 4; | |
875 for (1 .. $nent) { | |
876 my $flags = hex unpack "\@$skip H2", $buf; $skip += 1; | |
877 my $id = hex unpack "\@$skip H6", $buf; $skip += 3; | |
878 $payload{$id}{flags} = $flags; | |
879 $payload{$id}{value} = unpack "\@$skip N", $buf; $skip += 4; | |
880 } | |
881 return \%payload; | |
882 } | |
883 | |
884 sub ping { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
885 my ($ctx, $buf) = @_; |
374 | 886 my %payload; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
887 my $skip = 5; |
374 | 888 |
889 $payload{length} = hex(unpack "\@$skip H6", $buf); $skip += 3; | |
890 $payload{type} = 'PING'; | |
891 $payload{value} = unpack "\@$skip N", $buf; | |
892 return \%payload; | |
893 } | |
894 | |
895 sub goaway { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
896 my ($ctx, $buf) = @_; |
374 | 897 my %payload; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
898 my $skip = 5; |
374 | 899 |
900 $payload{length} = hex unpack "\@$skip H6", $buf; $skip += 3; | |
901 $payload{type} = 'GOAWAY'; | |
902 $payload{sid} = unpack "\@$skip N", $buf; $skip += 4; | |
903 $payload{code} = unpack "\@$skip N", $buf; | |
904 return \%payload; | |
905 } | |
906 | |
907 sub window_update { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
908 my ($ctx, $buf) = @_; |
374 | 909 my %payload; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
910 my $skip = 5; |
374 | 911 |
912 $payload{length} = hex(unpack "\@$skip H6", $buf); $skip += 3; | |
913 $payload{type} = 'WINDOW_UPDATE'; | |
914 | |
915 my $stream = unpack "\@$skip B32", $buf; $skip += 4; | |
916 substr($stream, 0, 1) = 0; | |
917 $stream = unpack("N", pack("B32", $stream)); | |
918 $payload{sid} = $stream; | |
919 | |
920 my $value = unpack "\@$skip B32", $buf; | |
921 substr($value, 0, 1) = 0; | |
922 $payload{wdelta} = unpack("N", pack("B32", $value)); | |
923 return \%payload; | |
924 } | |
925 | |
926 sub hpack { | |
927 my ($name, $value) = @_; | |
928 | |
929 pack("N", length($name)) . $name . pack("N", length($value)) . $value; | |
930 } | |
931 | |
932 sub hunpack { | |
933 my ($data) = @_; | |
934 my %headers; | |
935 my $skip = 0; | |
936 | |
937 my $nent = unpack "\@$skip N", $data; $skip += 4; | |
938 for (1 .. $nent) { | |
939 my $len = unpack("\@$skip N", $data); $skip += 4; | |
940 my $name = unpack("\@$skip A$len", $data); $skip += $len; | |
941 | |
942 $len = unpack("\@$skip N", $data); $skip += 4; | |
943 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
|
944 $value .= "\0" x ($len - length $value); |
374 | 945 |
946 $headers{$name} = $value; | |
947 } | |
948 return \%headers; | |
949 } | |
950 | |
951 sub raw_read { | |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
952 my ($s, $buf, $len) = @_; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
953 my $got = ''; |
374 | 954 |
581
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
955 while (length($buf) < $len && IO::Select->new($s)->can_read(1)) { |
8593f34a12e5
Tests: fixed spdy tests hang on win32.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
956 $s->sysread($got, $len - length($buf)) or last; |
425
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
957 log_in($got); |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
958 $buf .= $got; |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
959 } |
cc7da696a330
Tests: reduced execution time of SPDY tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
416
diff
changeset
|
960 return $buf; |
374 | 961 } |
962 | |
963 sub raw_write { | |
964 my ($s, $message) = @_; | |
965 | |
966 local $SIG{PIPE} = 'IGNORE'; | |
967 | |
968 while (IO::Select->new($s)->can_write(0.4)) { | |
969 log_out($message); | |
970 my $n = $s->syswrite($message); | |
971 last unless $n; | |
972 $message = substr($message, $n); | |
973 last unless length $message; | |
974 } | |
975 } | |
976 | |
977 sub new_session { | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
978 my ($port, %extra) = @_; |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
979 my ($d, $i, $status, $s); |
374 | 980 |
981 ($d, $status) = Compress::Raw::Zlib::Deflate->new( | |
982 -WindowBits => 12, | |
983 -Dictionary => dictionary(), | |
984 -Level => Compress::Raw::Zlib->Z_NO_COMPRESSION | |
985 ); | |
986 fail "Zlib failure: $status" unless $d; | |
987 | |
988 ($i, $status) = Compress::Raw::Zlib::Inflate->new( | |
989 -WindowBits => Compress::Raw::Zlib->WANT_GZIP_OR_ZLIB, | |
990 -Dictionary => dictionary() | |
991 ); | |
992 fail "Zlib failure: $status" unless $i; | |
993 | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
994 $s = new_socket($port); |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
995 |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
996 if ($extra{proxy}) { |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
997 raw_write($s, $extra{proxy}); |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
998 } |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
999 |
374 | 1000 return { zlib => { i => $i, d => $d }, |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1001 socket => $s, last_stream => -1 }; |
374 | 1002 } |
1003 | |
1004 sub new_socket { | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1005 my ($port) = @_; |
374 | 1006 my $s; |
1007 | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1008 $port = 8080 unless defined $port; |
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1009 |
374 | 1010 eval { |
1011 local $SIG{ALRM} = sub { die "timeout\n" }; | |
1012 local $SIG{PIPE} = sub { die "sigpipe\n" }; | |
1013 alarm(2); | |
1014 $s = IO::Socket::INET->new( | |
1015 Proto => 'tcp', | |
427
daea9cf92c14
Tests: added proxy protocol tests over SPDY.
Sergey Kandaurov <pluknet@nginx.com>
parents:
426
diff
changeset
|
1016 PeerAddr => "127.0.0.1:$port", |
374 | 1017 ); |
1018 alarm(0); | |
1019 }; | |
1020 alarm(0); | |
1021 | |
1022 if ($@) { | |
1023 log_in("died: $@"); | |
1024 return undef; | |
1025 } | |
1026 | |
1027 return $s; | |
1028 } | |
1029 | |
1030 sub dictionary { | |
1031 join('', (map pack('N/a*', $_), qw( | |
1032 options | |
1033 head | |
1034 post | |
1035 put | |
1036 delete | |
1037 trace | |
1038 accept | |
1039 accept-charset | |
1040 accept-encoding | |
1041 accept-language | |
1042 accept-ranges | |
1043 age | |
1044 allow | |
1045 authorization | |
1046 cache-control | |
1047 connection | |
1048 content-base | |
1049 content-encoding | |
1050 content-language | |
1051 content-length | |
1052 content-location | |
1053 content-md5 | |
1054 content-range | |
1055 content-type | |
1056 date | |
1057 etag | |
1058 expect | |
1059 expires | |
1060 from | |
1061 host | |
1062 if-match | |
1063 if-modified-since | |
1064 if-none-match | |
1065 if-range | |
1066 if-unmodified-since | |
1067 last-modified | |
1068 location | |
1069 max-forwards | |
1070 pragma | |
1071 proxy-authenticate | |
1072 proxy-authorization | |
1073 range | |
1074 referer | |
1075 retry-after | |
1076 server | |
1077 te | |
1078 trailer | |
1079 transfer-encoding | |
1080 upgrade | |
1081 user-agent | |
1082 vary | |
1083 via | |
1084 warning | |
1085 www-authenticate | |
1086 method | |
1087 get | |
1088 status), "200 OK", | |
1089 qw(version HTTP/1.1 url public set-cookie keep-alive origin)), | |
1090 "100101201202205206300302303304305306307402405406407408409410", | |
1091 "411412413414415416417502504505", | |
1092 "203 Non-Authoritative Information", | |
1093 "204 No Content", | |
1094 "301 Moved Permanently", | |
1095 "400 Bad Request", | |
1096 "401 Unauthorized", | |
1097 "403 Forbidden", | |
1098 "404 Not Found", | |
1099 "500 Internal Server Error", | |
1100 "501 Not Implemented", | |
1101 "503 Service Unavailable", | |
1102 "Jan Feb Mar Apr May Jun Jul Aug Sept Oct Nov Dec", | |
1103 " 00:00:00", | |
1104 " Mon, Tue, Wed, Thu, Fri, Sat, Sun, GMT", | |
1105 "chunked,text/html,image/png,image/jpg,image/gif,", | |
1106 "application/xml,application/xhtml+xml,text/plain,", | |
1107 "text/javascript,public", "privatemax-age=gzip,deflate,", | |
1108 "sdchcharset=utf-8charset=iso-8859-1,utf-,*,enq=0." | |
1109 ); | |
1110 } | |
1111 | |
1112 ############################################################################### | |
487
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1113 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1114 # reply with multiple (also empty) header values |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1115 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1116 sub http_daemon { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1117 my $server = IO::Socket::INET->new( |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1118 Proto => 'tcp', |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1119 LocalHost => '127.0.0.1', |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1120 LocalPort => 8083, |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1121 Listen => 5, |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1122 Reuse => 1 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1123 ) |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1124 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
|
1125 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1126 local $SIG{PIPE} = 'IGNORE'; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1127 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1128 while (my $client = $server->accept()) { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1129 $client->autoflush(1); |
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 my $headers = ''; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1132 my $uri = ''; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1133 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1134 while (<$client>) { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1135 $headers .= $_; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1136 last if (/^\x0d?\x0a?$/); |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1137 } |
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 next if $headers eq ''; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1140 $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
|
1141 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1142 if ($uri eq '/inside') { |
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 print $client <<EOF; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1145 HTTP/1.1 200 OK |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1146 Connection: close |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1147 X-Foo: val1 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1148 X-Foo: |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1149 X-Foo: val2 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1150 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1151 EOF |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1152 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1153 } elsif ($uri eq '/first') { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1154 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1155 print $client <<EOF; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1156 HTTP/1.1 200 OK |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1157 Connection: close |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1158 X-Foo: |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1159 X-Foo: val1 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1160 X-Foo: val2 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1161 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1162 EOF |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1163 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1164 } elsif ($uri eq '/last') { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1165 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1166 print $client <<EOF; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1167 HTTP/1.1 200 OK |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1168 Connection: close |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1169 X-Foo: val1 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1170 X-Foo: val2 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1171 X-Foo: |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1172 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1173 EOF |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1174 } |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1175 |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1176 } continue { |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1177 close $client; |
c5ff54b56710
Tests: SPDY tests for empty header value.
Sergey Kandaurov <pluknet@nginx.com>
parents:
486
diff
changeset
|
1178 } |
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 ############################################################################### |