# HG changeset patch # User Sergey Kandaurov # Date 1445980302 -10800 # Node ID 84a52b6d63437335ec6d1ac0044026b31fb2c352 # Parent 63d1b7cb974a3fa725fbf126bb50f6458735c9da Tests: HTTP/2 regression test for incomplete HEADERS payload. diff --git a/h2.t b/h2.t --- a/h2.t +++ b/h2.t @@ -2247,6 +2247,11 @@ is($frame->{headers}->{':status'}, 400, ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; is($frame->{headers}->{':status'}, 400, 'empty authority'); +# aborted stream with zero HEADERS payload followed by client connection close + +new_stream(new_session(), { split => [ 9 ], abort => 1 }) + if $ENV{TEST_NGINX_UNSAFE}; + # unknown frame type $sess = new_session(); @@ -2436,10 +2441,12 @@ sub new_stream { $split = ref $uri->{split} && $uri->{split} || []; for (@$split) { raw_write($ctx->{socket}, substr($buf, 0, $_, "")); + goto done if $uri->{abort}; select undef, undef, undef, 0.2; } raw_write($ctx->{socket}, $buf); +done: return $ctx->{last_stream}; }