[nginx] Upstream: fixed unexpected tcp_nopush usage on peer connections.

Maxim Dounin mdounin at mdounin.ru
Mon Jul 2 16:40:21 UTC 2018


details:   http://hg.nginx.org/nginx/rev/8eab05b83dde
branches:  
changeset: 7306:8eab05b83dde
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon Jul 02 19:02:31 2018 +0300
description:
Upstream: fixed unexpected tcp_nopush usage on peer connections.

Now tcp_nopush on peer connections is disabled if it is disabled on
the client connection, similar to how we handle c->sendfile.  Previously,
tcp_nopush was always used on upstream connections, regardless of
the "tcp_nopush" directive.

diffstat:

 src/http/ngx_http_upstream.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1556,6 +1556,10 @@ ngx_http_upstream_connect(ngx_http_reque
     c->sendfile &= r->connection->sendfile;
     u->output.sendfile = c->sendfile;
 
+    if (r->connection->tcp_nopush == NGX_TCP_NOPUSH_DISABLED) {
+        c->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
+    }
+
     if (c->pool == NULL) {
 
         /* we need separate pool here to be able to cache SSL connections */


More information about the nginx-devel mailing list