From 09b41d5eab2d4743d696989d38914556bd315627 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Mon, 11 Jan 2021 22:06:27 +0300 Subject: Version bump. --- src/core/nginx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') 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 -- cgit From 2ec8fac2d6b8e5023c9894d10bc50d78e63f242c Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Tue, 19 Jan 2021 20:32:00 +0300 Subject: Core: removed post_accept_timeout. Keeping post_accept_timeout in ngx_listening_t is no longer needed since we've switched to 1 second timeout for deferred accept in 5541:fdb67cfc957d. Further, using it in HTTP code can result in client_header_timeout being used from an incorrect server block, notably if address-specific virtual servers are used along with a wildcard listening socket, or if we've switched to a different server block based on SNI in SSL handshake. --- src/core/ngx_connection.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/core') diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h index ad6556d0c..9d8ac46d2 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; -- cgit From 9a3ec202322b174acb5973d8f55cf570f1177149 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Thu, 11 Feb 2021 21:52:11 +0300 Subject: Additional connections reuse. If ngx_drain_connections() fails to immediately reuse any connections and there are no free connections, it now additionally tries to reuse a connection again. This helps to provide at least one free connection in case of HTTP/2 with lingering close, where merely trying to reuse a connection once does not free it, but makes it reusable again, waiting for lingering close. --- src/core/ngx_connection.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/core') diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c index c082d0dac..8339e2bb7 100644 --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -1310,6 +1310,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++) { @@ -1326,6 +1327,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); + } } -- cgit