]> git.kaiwu.me - nginx.git/commitdiff
Upstream: fixed unexpected tcp_nopush usage on peer connections.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 2 Jul 2018 16:02:31 +0000 (19:02 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 2 Jul 2018 16:02:31 +0000 (19:02 +0300)
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.

src/http/ngx_http_upstream.c

index 47cc6cc552c6125a15df4d336f512e2aac33dc1b..688acd806ca454180c17b4248ad4a41fc9d30a11 100644 (file)
@@ -1556,6 +1556,10 @@ ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u)
     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 */