]> git.kaiwu.me - nginx.git/commitdiff
Proxy: disabled keepalive on extra data in non-buffered mode.
authorAwdhesh Mathpal <mathpal@amazon.com>
Fri, 8 Oct 2021 02:23:11 +0000 (19:23 -0700)
committerAwdhesh Mathpal <mathpal@amazon.com>
Fri, 8 Oct 2021 02:23:11 +0000 (19:23 -0700)
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.

src/http/modules/ngx_http_proxy_module.c

index 084462746a112aa4e6f3e25ad12bffde547d648a..a5cc27b1ec35fe082fe2d863eb0a5036775497f9 100644 (file)
@@ -2337,6 +2337,7 @@ ngx_http_proxy_non_buffered_copy_filter(void *data, ssize_t bytes)
         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;
     }