Changeset 1272:01010d9021b8 in nginx-tests


Ignore:
Timestamp:
01/29/18 12:14:18 (2 years ago)
Author:
Sergey Kandaurov <pluknet@…>
Branch:
default
Phase:
public
Message:

Tests: HTTP/2 INITIAL_WINDOW_SIZE duplicate settings handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • h2.t

    r1251 r1272  
    2727
    2828my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite charset gzip/)
    29         ->plan(144);
     29        ->plan(147);
    3030
    3131$t->write_file_expand('nginx.conf', <<'EOF');
     
    753753is($sum, 2**16 + 80, 'iws - increased');
    754754
     755# INITIAL_WINDOW_SIZE duplicate settings
     756
     757# 6.5.  SETTINGS
     758#   Each parameter in a SETTINGS frame replaces any existing value for
     759#   that parameter.  Parameters are processed in the order in which they
     760#   appear, and a receiver of a SETTINGS frame does not need to maintain
     761#   any state other than the current value of its parameters.  Therefore,
     762#   the value of a SETTINGS parameter is the last value that is seen by a
     763#   receiver.
     764
     765$s = Test::Nginx::HTTP2->new();
     766$s->h2_window(2**17);
     767
     768$sid = $s->new_stream({ path => '/t1.html' });
     769
     770$frames = $s->read(all => [{ sid => $sid, length => 2**16 - 1 }]);
     771@data = grep { $_->{type} eq "DATA" } @$frames;
     772$sum = eval join '+', map { $_->{length} } @data;
     773is($sum, 2**16 - 1, 'iws duplicate - default stream window');
     774
     775TODO: {
     776local $TODO = 'not yet';
     777
     778# this should effect in extra stream window octect
     779# $s->h2_settings(0, 0x4 => 42, 0x4 => 2**16);
     780{
     781        local $SIG{PIPE} = 'IGNORE';
     782        syswrite($s->{socket}, pack("x2C2x5nNnN", 12, 0x4, 4, 42, 4, 2**16));
     783}
     784
     785$frames = $s->read(all => [{ sid => $sid, length => 1 }]);
     786@data = grep { $_->{type} eq "DATA" } @$frames;
     787$sum = eval join '+', map { $_->{length} } @data;
     788is($sum, 1, 'iws duplicate - updated stream window');
     789
     790# yet more octets to finish receiving the response
     791
     792$s->h2_settings(0, 0x4 => 2**16 + 80);
     793
     794$frames = $s->read(all => [{ sid => $sid, length => 80 }]);
     795@data = grep { $_->{type} eq "DATA" } @$frames;
     796$sum = eval join '+', map { $_->{length} } @data;
     797is($sum, 80, 'iws duplicate - updated stream window 2');
     798
     799}
     800
    755801# probe for negative available space in a flow control window
    756802
Note: See TracChangeset for help on using the changeset viewer.