Tests: $connection_requests and $connection_time tests.
diff --git a/h2_max_requests.t b/h2_max_requests.t
index a0c36f6..dd49893 100644
--- a/h2_max_requests.t
+++ b/h2_max_requests.t
@@ -63,6 +63,8 @@
keepalive_time 1s;
+ add_header X-Conn $connection_requests:$connection_time;
+
location / { }
}
}
@@ -75,7 +77,7 @@
# suppress deprecation warning
open OLDERR, ">&", \*STDERR; close STDERR;
-$t->try_run('no keepalive_time')->plan(17);
+$t->try_run('no keepalive_time')->plan(19);
open STDERR, ">&", \*OLDERR;
###############################################################################
@@ -158,6 +160,7 @@
($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
is($frame->{headers}->{':status'}, 200, 'keepalive time request');
+like($frame->{headers}->{'x-conn'}, qr/^1:0/, 'keepalive time variables');
$frames = $s->read(all => [{ type => 'GOAWAY' }], wait => 0.5);
@@ -171,6 +174,7 @@
($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
is($frame->{headers}->{':status'}, 200, 'keepalive time request 2');
+like($frame->{headers}->{'x-conn'}, qr/^2:[^0]/, 'keepalive time variables 2');
($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
ok($frame, 'keepalive time limit - GOAWAY');
diff --git a/http_keepalive.t b/http_keepalive.t
index 4389c1a..e20f25b 100644
--- a/http_keepalive.t
+++ b/http_keepalive.t
@@ -49,6 +49,8 @@
keepalive_requests 2;
keepalive_timeout 1 9;
+ add_header X-Conn $connection_requests:$connection_time;
+
location / { }
location /r {
keepalive_requests 4;
@@ -83,7 +85,7 @@
$t->write_file('safari', '');
$t->write_file('none', '');
$t->write_file('zero', '');
-$t->try_run('no keepalive_time')->plan(20);
+$t->try_run('no keepalive_time')->plan(21);
###############################################################################
@@ -127,6 +129,8 @@
is(() = $r =~ /(200 OK)/g, 2, 'keepalive time limit requests');
like($r, qr/Connection: close/, 'keepalive time limit connection');
+like($r, qr/X-Conn: 1:0.*X-Conn: 2:[^0]/s, 'keepalive time limit variables');
+
# cancel keepalive on EOF while discarding body
my $s = http(<<EOF, start => 1);