Mercurial > hg > nginx
comparison src/core/ngx_resolver.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 | eb54227110f0 |
children | 2fd40ee19c20 |
comparison
equal
deleted
inserted
replaced
7819:3674d5b7174e | 7820:fdc3d40979b0 |
---|---|
4457 | 4457 |
4458 rec->udp = c; | 4458 rec->udp = c; |
4459 | 4459 |
4460 c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1); | 4460 c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1); |
4461 | 4461 |
4462 c->start_time = ngx_current_msec; | |
4463 | |
4462 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, &rec->log, 0, | 4464 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, &rec->log, 0, |
4463 "connect to %V, fd:%d #%uA", &rec->server, s, c->number); | 4465 "connect to %V, fd:%d #%uA", &rec->server, s, c->number); |
4464 | 4466 |
4465 rc = connect(s, rec->sockaddr, rec->socklen); | 4467 rc = connect(s, rec->sockaddr, rec->socklen); |
4466 | 4468 |
4542 wev->log = &rec->log; | 4544 wev->log = &rec->log; |
4543 | 4545 |
4544 rec->tcp = c; | 4546 rec->tcp = c; |
4545 | 4547 |
4546 c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1); | 4548 c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1); |
4549 | |
4550 c->start_time = ngx_current_msec; | |
4547 | 4551 |
4548 if (ngx_add_conn) { | 4552 if (ngx_add_conn) { |
4549 if (ngx_add_conn(c) == NGX_ERROR) { | 4553 if (ngx_add_conn(c) == NGX_ERROR) { |
4550 goto failed; | 4554 goto failed; |
4551 } | 4555 } |