# HG changeset patch # User Sergey Kandaurov # Date 1445980306 -10800 # Node ID 14d6f69b7d9d296459d7b304c58faf8ed98c23d7 # Parent 5dcd998daace02747cefd95ad7829a390ee19821 Tests: added HTTP/2 proxy cache tests for empty DATA frame. 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(276); + ->has_daemon('openssl')->plan(279); # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL @@ -1336,6 +1336,22 @@ is($frame->{headers}->{':status'}, 304, push @$frames, $_ for @{h2_read($sess, all => [{ sid => $sid }])}; ok(!grep ({ $_->{type} eq "DATA" } @$frames), 'proxy cache HEAD - no body'); +# proxy cache - expect no stray empty DATA frame + +TODO: { +local $TODO = 'not yet'; + +$sess = new_session(); +$sid = new_stream($sess, { path => '/cache/t2.html?2' }); + +$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); +@data = grep ({ $_->{type} eq "DATA" } @$frames); +is(@data, 1, 'proxy cache write - data frames'); +is(join(' ', map { $_->{data} } @data), 'SEE-THIS', 'proxy cache write - data'); +is(join(' ', map { $_->{flags} } @data), '1', 'proxy cache write - flags'); + +} + # HEAD on empty cache with proxy_buffering off $sess = new_session();