changeset 740:3e2676108d69

Tests: added HTTP/2 test for queued stream cleanup.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 19 Oct 2015 17:04:25 +0300
parents 610e394a6e73
children a2e7f5ff3aa8
files h2.t
diffstat 1 files changed, 20 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(227);
+	->has_daemon('openssl')->plan(228);
 
 # Some systems have a bug in not treating zero writev iovcnt as EINVAL
 
@@ -1359,6 +1359,25 @@ is($frame->{headers}->{':status'}, 200, 
 $sum = eval join '+', map { $_->{length} } @data;
 is($sum, 5000000, 'large response - DATA');
 
+# stream with large response queued on write - RST_STREAM handling
+
+$sess = new_session();
+$sid = new_stream($sess, { path => '/tbig.html' });
+
+h2_window($sess, 2**30, $sid);
+h2_window($sess, 2**30);
+
+select undef, undef, undef, 0.4;
+
+h2_rst($sess, $sid, 8);
+h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
+
+$sid = new_stream($sess);
+$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
+
+($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
+is($frame->{sid}, 3, 'large response - queued with RST_STREAM');
+
 # SETTINGS_MAX_FRAME_SIZE
 
 $sess = new_session();