[nginx] Proxy: disabled keepalive on extra data in non-buffered mode.

Maxim Dounin mdounin at mdounin.ru
Tue Oct 12 16:48:27 UTC 2021


details:   https://hg.nginx.org/nginx/rev/055b2a847117
branches:  
changeset: 7931:055b2a847117
user:      Awdhesh Mathpal <mathpal at amazon.com>
date:      Thu Oct 07 19:23:11 2021 -0700
description:
Proxy: disabled keepalive on extra data in non-buffered mode.

The u->keepalive flag is initialized early if the response has no body
(or an empty body), and needs to be reset if there are any extra data,
similarly to how it is done in ngx_http_proxy_copy_filter().  Missed
in 83c4622053b0.

diffstat:

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

diffs (11 lines):

diff -r ae7c767aa491 -r 055b2a847117 src/http/modules/ngx_http_proxy_module.c
--- a/src/http/modules/ngx_http_proxy_module.c	Wed Oct 06 18:01:42 2021 +0300
+++ b/src/http/modules/ngx_http_proxy_module.c	Thu Oct 07 19:23:11 2021 -0700
@@ -2337,6 +2337,7 @@ ngx_http_proxy_non_buffered_copy_filter(
         ngx_log_error(NGX_LOG_WARN, r->connection->log, 0,
                       "upstream sent more data than specified in "
                       "\"Content-Length\" header");
+        u->keepalive = 0;
         return NGX_OK;
     }
 


More information about the nginx-devel mailing list