diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2021-04-08 00:15:48 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2021-04-08 00:15:48 +0300 |
commit | d9996d6f27150bfb9c9c00d77fac940712aa1d28 (patch) | |
tree | 0dddf15a4e9c9d31cb66677ea7f8746e9402f4c7 /src/http/v2/ngx_http_v2.c | |
parent | 5599731c00bd152f765c7cea24a7d257bf13320c (diff) | |
download | nginx-d9996d6f27150bfb9c9c00d77fac940712aa1d28.tar.gz nginx-d9996d6f27150bfb9c9c00d77fac940712aa1d28.zip |
Introduced the "keepalive_time" directive.
Similar to lingering_time, it limits total connection lifetime before
keepalive is switched off. The default is 1 hour, which is close to
the total maximum connection lifetime possible with default
keepalive_requests and keepalive_timeout.
Diffstat (limited to 'src/http/v2/ngx_http_v2.c')
-rw-r--r-- | src/http/v2/ngx_http_v2.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c index 69a94b6ee..3611a2e50 100644 --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -1369,7 +1369,9 @@ ngx_http_v2_state_headers(ngx_http_v2_connection_t *h2c, u_char *pos, ngx_http_core_module); if (clcf->keepalive_timeout == 0 - || h2c->connection->requests >= clcf->keepalive_requests) + || h2c->connection->requests >= clcf->keepalive_requests + || ngx_current_msec - h2c->connection->start_time + > clcf->keepalive_time) { h2c->goaway = 1; |