diff options
| author | Sergey Kandaurov <pluknet@nginx.com> | 2021-02-17 14:48:35 +0300 |
|---|---|---|
| committer | Sergey Kandaurov <pluknet@nginx.com> | 2021-02-17 14:48:35 +0300 |
| commit | 8ca2f73073da431d8e747589eac5b49a7c0faa5b (patch) | |
| tree | 6d5f46eb2dccc4cacc13a3e353f78f940f310bbb /src/core | |
| parent | b93b056261114022b08f11413f959d3af687b7a7 (diff) | |
| parent | 949c97007b9c6010e958c36653e33c3f5bf34540 (diff) | |
| download | nginx-8ca2f73073da431d8e747589eac5b49a7c0faa5b.tar.gz nginx-8ca2f73073da431d8e747589eac5b49a7c0faa5b.tar.bz2 | |
Merged with the default branch.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/nginx.h | 4 | ||||
| -rw-r--r-- | src/core/ngx_connection.c | 16 | ||||
| -rw-r--r-- | src/core/ngx_connection.h | 2 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/core/nginx.h b/src/core/nginx.h index e915be3e7..b926ba6fe 100644 --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -9,8 +9,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1019006 -#define NGINX_VERSION "1.19.6" +#define nginx_version 1019007 +#define NGINX_VERSION "1.19.7" #define NGINX_VER "nginx/" NGINX_VERSION #ifdef NGX_BUILD diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c index 21f9980f2..2c0346f6b 100644 --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -1316,6 +1316,7 @@ ngx_drain_connections(ngx_cycle_t *cycle) cycle->connection_n); } + c = NULL; n = ngx_max(ngx_min(32, cycle->reusable_connections_n / 8), 1); for (i = 0; i < n; i++) { @@ -1332,6 +1333,21 @@ ngx_drain_connections(ngx_cycle_t *cycle) c->close = 1; c->read->handler(c->read); } + + if (cycle->free_connection_n == 0 && c && c->reusable) { + + /* + * if no connections were freed, try to reuse the last + * connection again: this should free it as long as + * previous reuse moved it to lingering close + */ + + ngx_log_debug0(NGX_LOG_DEBUG_CORE, c->log, 0, + "reusing connection again"); + + c->close = 1; + c->read->handler(c->read); + } } diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h index edc1ccbc2..548c83569 100644 --- a/src/core/ngx_connection.h +++ b/src/core/ngx_connection.h @@ -45,8 +45,6 @@ struct ngx_listening_s { size_t pool_size; /* should be here because of the AcceptEx() preread */ size_t post_accept_buffer_size; - /* should be here because of the deferred accept */ - ngx_msec_t post_accept_timeout; ngx_listening_t *previous; ngx_connection_t *connection; |
