changeset 698:f86c8314d205

Tests: one more HTTP/2 test for max frame size. Ensure that CONTINUATION frame size is limited.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 15 Sep 2015 18:44:09 +0300
parents 46f698a7e59c
children 5768830f01c4
files h2.t
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h2.t
+++ b/h2.t
@@ -32,7 +32,7 @@ plan(skip_all => 'IO::Socket::SSL too ol
 
 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/)
 	->has(qw/limit_conn rewrite realip shmem/)
-	->has_daemon('openssl')->plan(194);
+	->has_daemon('openssl')->plan(195);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -60,6 +60,7 @@ http {
         ssl_certificate_key localhost.key;
         ssl_certificate localhost.crt;
         http2_max_field_size 128k;
+        http2_max_header_size 128k;
 
         location / {
             add_header X-Header X-Foo;
@@ -1132,6 +1133,21 @@ is($data[1]->{flags}, 0, 'no body CONTIN
 is($data[2]->{type}, 'CONTINUATION', 'no body CONTINUATION - third');
 is($data[2]->{flags}, 4, 'no body CONTINUATION - third flags');
 
+# response header block is always split by SETTINGS_MAX_FRAME_SIZE
+
+TODO: {
+local $TODO = 'not yet';
+
+$sess = new_session();
+$sid = new_stream($sess, { path => '/continuation?h=' . 'x' x 2**14 });
+
+$frames = h2_read($sess, all => [{ sid => $sid, fin => 0x4 }]);
+@data = grep { $_->{type} =~ "HEADERS|CONTINUATION" } @$frames;
+@data = sort { $a <=> $b } map { $_->{length} } @data;
+cmp_ok($data[-1], '<=', 2**14, 'response header frames limited');
+
+}
+
 # max_field_size
 
 $sess = new_session(8087);