comparison h2.t @ 850:2b1d0f6c9d41

Tests: added HTTP/2 huffman encoding tests against complete table. Though barely useful, it allows to see if the table is somehow damaged.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 08 Feb 2016 14:47:07 +0300
parents cebd29c253ea
children e0d6ba59968f
comparison
equal deleted inserted replaced
849:cebd29c253ea 850:2b1d0f6c9d41
30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); }; 30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); };
31 plan(skip_all => 'IO::Socket::SSL too old') if $@; 31 plan(skip_all => 'IO::Socket::SSL too old') if $@;
32 32
33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) 33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/)
34 ->has(qw/limit_conn rewrite realip shmem/) 34 ->has(qw/limit_conn rewrite realip shmem/)
35 ->has_daemon('openssl')->plan(312); 35 ->has_daemon('openssl')->plan(314);
36 36
37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL 37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL
38 38
39 $t->todo_alerts(); 39 $t->todo_alerts();
40 40
778 778
779 TODO: { 779 TODO: {
780 local $TODO = 'not yet'; 780 local $TODO = 'not yet';
781 781
782 unlike($sess->{headers}, qr/aaaaa/, 'well known chars - huffman encoding'); 782 unlike($sess->{headers}, qr/aaaaa/, 'well known chars - huffman encoding');
783
784 }
785
786 # response header field with huffman encoding - complete table mod \0, CR, LF
787 # first saturate with short-encoded characters (NB: implementation detail)
788
789 my $field = pack "C*", ((map { 97 } (1 .. 862)), 1 .. 9, 11, 12, 14 .. 255);
790
791 $sess = new_session();
792 $sid = new_stream($sess, { headers => [
793 { name => ':method', value => 'GET', mode => 0 },
794 { name => ':scheme', value => 'http', mode => 0 },
795 { name => ':path', value => '/', mode => 0 },
796 { name => ':authority', value => 'localhost', mode => 1 },
797 { name => 'x-foo', value => $field, mode => 2 }]});
798 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
799
800 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
801 is($frame->{headers}->{'x-sent-foo'}, $field, 'all chars');
802
803 TODO: {
804 local $TODO = 'not yet';
805
806 unlike($sess->{headers}, qr/abcde/, 'all chars - huffman encoding');
783 807
784 } 808 }
785 809
786 # 6.3. Dynamic Table Size Update 810 # 6.3. Dynamic Table Size Update
787 811