diff options
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; |