[nginx] Proxy: replaced some r->upstream usage with the "u" vari...

Maxim Dounin mdounin at mdounin.ru
Mon Aug 18 00:30:23 UTC 2025


details:   http://freenginx.org/hg/nginx/rev/639c6a28cb0b
branches:  
changeset: 9398:639c6a28cb0b
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon Aug 18 03:18:10 2025 +0300
description:
Proxy: replaced some r->upstream usage with the "u" variable.

No functional changes.

diffstat:

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

diffs (41 lines):

diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1958,13 +1958,15 @@ ngx_http_proxy_process_header(ngx_http_r
             ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                            "http proxy header done");
 
+            u = r->upstream;
+
             /*
              * if no "Server" and "Date" in header line,
              * then add the special empty headers
              */
 
-            if (r->upstream->headers_in.server == NULL) {
-                h = ngx_list_push(&r->upstream->headers_in.headers);
+            if (u->headers_in.server == NULL) {
+                h = ngx_list_push(&u->headers_in.headers);
                 if (h == NULL) {
                     return NGX_ERROR;
                 }
@@ -1978,8 +1980,8 @@ ngx_http_proxy_process_header(ngx_http_r
                 h->next = NULL;
             }
 
-            if (r->upstream->headers_in.date == NULL) {
-                h = ngx_list_push(&r->upstream->headers_in.headers);
+            if (u->headers_in.date == NULL) {
+                h = ngx_list_push(&u->headers_in.headers);
                 if (h == NULL) {
                     return NGX_ERROR;
                 }
@@ -1994,8 +1996,6 @@ ngx_http_proxy_process_header(ngx_http_r
 
             /* clear content length if response is chunked */
 
-            u = r->upstream;
-
             if (u->headers_in.chunked) {
                 u->headers_in.content_length_n = -1;
             }


More information about the nginx-devel mailing list