changeset 680:85e368105c8b

Tests: added HTTP/2 tests for SETTINGS_MAX_FRAME_SIZE.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 08 Sep 2015 15:12:23 +0300
parents b60c1a207675
children 1f8e15e1899a
files h2.t
diffstat 1 files changed, 27 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(168);
+	->has_daemon('openssl')->plan(170);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -76,6 +76,11 @@ http {
             gzip_min_length 0;
             alias %%TESTDIR%%/t2.html;
         }
+        location /frame_size {
+            http2_chunk_size 64k;
+            alias %%TESTDIR%%/t1.html;
+            output_buffers 2 1m;
+        }
         location /pp {
             set_real_ip_from 127.0.0.1/32;
             real_ip_header proxy_protocol;
@@ -1043,6 +1048,27 @@ is(@$frames, 1, 'positive window');
 is(@$frames[0]->{type}, 'DATA', 'positive window - data');
 is(@$frames[0]->{length}, 1, 'positive window - data length');
 
+# SETTINGS_MAX_FRAME_SIZE
+
+$sess = new_session();
+$sid = new_stream($sess, { path => '/frame_size' });
+h2_window($sess, 2**18, 1);
+h2_window($sess, 2**18);
+
+$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
+@data = grep { $_->{type} eq "DATA" } @$frames;
+is($data[0]->{length}, 2**14, 'max frame size - default');
+
+$sess = new_session();
+h2_settings($sess, 0, 0x5 => 2**15);
+$sid = new_stream($sess, { path => '/frame_size' });
+h2_window($sess, 2**18, 1);
+h2_window($sess, 2**18);
+
+$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
+@data = grep { $_->{type} eq "DATA" } @$frames;
+is($data[0]->{length}, 2**15, 'max frame size - custom');
+
 # stream multiplexing + WINDOW_UPDATE
 
 $sess = new_session();