Mercurial > hg > nginx
comparison src/http/v2/ngx_http_v2.c @ 7820:fdc3d40979b0
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 08 Apr 2021 00:15:48 +0300 |
parents | 3674d5b7174e |
children | 63c66b7cc07c |
comparison
equal
deleted
inserted
replaced
7819:3674d5b7174e | 7820:fdc3d40979b0 |
---|---|
1367 | 1367 |
1368 clcf = ngx_http_get_module_loc_conf(h2c->http_connection->conf_ctx, | 1368 clcf = ngx_http_get_module_loc_conf(h2c->http_connection->conf_ctx, |
1369 ngx_http_core_module); | 1369 ngx_http_core_module); |
1370 | 1370 |
1371 if (clcf->keepalive_timeout == 0 | 1371 if (clcf->keepalive_timeout == 0 |
1372 || h2c->connection->requests >= clcf->keepalive_requests) | 1372 || h2c->connection->requests >= clcf->keepalive_requests |
1373 || ngx_current_msec - h2c->connection->start_time | |
1374 > clcf->keepalive_time) | |
1373 { | 1375 { |
1374 h2c->goaway = 1; | 1376 h2c->goaway = 1; |
1375 | 1377 |
1376 if (ngx_http_v2_send_goaway(h2c, NGX_HTTP_V2_NO_ERROR) == NGX_ERROR) { | 1378 if (ngx_http_v2_send_goaway(h2c, NGX_HTTP_V2_NO_ERROR) == NGX_ERROR) { |
1377 return ngx_http_v2_connection_error(h2c, | 1379 return ngx_http_v2_connection_error(h2c, |