changeset 888:4ab795ab2e62

Tests: added HTTP/2 test for zero RST_STREAM if discarding body.
author Andrey Zelenkov <zelenkov@nginx.com>
date Fri, 01 Apr 2016 13:16:50 +0300
parents 5debefd670bc
children 266e3b2e88f9
files h2_request_body.t
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h2_request_body.t
+++ b/h2_request_body.t
@@ -23,7 +23,7 @@ use Test::Nginx::HTTP2 qw/ :DEFAULT :fra
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(34);
+my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(35);
 
 $t->todo_alerts();
 
@@ -147,6 +147,21 @@ is(read_body_file($frame->{headers}{'x-b
 
 }
 
+# request body discarded
+# RST_STREAM with zero code received
+
+TODO: {
+local $TODO = 'not yet';
+
+$sess = new_session();
+$sid = new_stream($sess, { body_more => 1 });
+$frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]);
+
+($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames;
+is($frame->{code}, 0, 'request body discarded - zero RST_STREAM');
+
+}
+
 # malformed request body length not equal to content-length
 
 $sess = new_session();