Hi:

In ngx_http_upstream_test_next, the loop will continue when the status is
matched, and the ngx_http_upstream_next_errors is non-repeating. I think we
can jump out of for the unnecessary loop, and here is my patch:

# HG changeset patch
# User Jinhua Tan <[email protected]>
# Date 1589378567 -28800
#      Wed May 13 22:02:47 2020 +0800
# Node ID c79fcc4cf3acb68ca0e5c7767820c23308c40f6e
# Parent  028b16e2798f8ec4c6a3d042a6ac8a07f7262690
Upstream: jump out of unnecessary loop after matching the status code.

diff -r 028b16e2798f -r c79fcc4cf3ac src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c      Fri May 08 19:19:16 2020 +0300
+++ b/src/http/ngx_http_upstream.c      Wed May 13 22:02:47 2020 +0800
@@ -2502,6 +2502,8 @@
         }

 #endif
+
+        break;
     }

 #if (NGX_HTTP_CACHE)

Thanks!
_______________________________________________
nginx-devel mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to