# HG changeset patch # User Sergey Kandaurov # Date 1449227914 -10800 # Node ID fed83003c45ce90277d2fe6c215ba636f76667a0 # Parent ee7e07d826b817d0e948208ecbf69982186c9a86 Tests: one more HTTP/2 write handler test. 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(291); + ->has_daemon('openssl')->plan(292); # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL @@ -1789,6 +1789,30 @@ is($frame->{headers}->{':status'}, 200, $sum = eval join '+', map { $_->{length} } @data; is($sum, 5000000, 'large response - DATA'); +# Make sure http2 write handler doesn't break a connection. +# Some buggy systems tolerate ill-use of writev() triggered by write handler, +# while others, such as darwin and NetBSD, follow POSIX strictly, which causes +# a connection to close in nginx. While this also breaks the 'no alerts' test, +# it doesn't suit well, because error.log is currently polluted with much more +# alerts due to other various bugs in ngx_http_v2_module. We catch it here in +# a separate test as well to make it clear. + +SKIP: { +skip 'tolerant operating system', 1 unless $^O eq 'darwin' or $^O eq 'netbsd'; + +TODO: { +local $TODO = 'not yet'; + +$sid = new_stream($sess); +$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); + +($frame) = grep { $_->{type} eq "HEADERS" } @$frames; +is($frame->{headers}->{':status'}, 200, 'new stream after large response'); + +} + +} + # write event send timeout $sess = new_session(8091);