# HG changeset patch # User Sergey Kandaurov # Date 1445263465 -10800 # Node ID 3e2676108d69f5550cf618169298f90ad33aa189 # Parent 610e394a6e73ee0cbb6e102b3c667d62207b9295 Tests: added HTTP/2 test for queued stream cleanup. diff --git a/h2.t b/h2.t --- 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();