Welcome! Log In Create A New Profile

Advanced

Upstream: jump out of unnecessary loop after matching the status code.

Jim T
May 13, 2020 10:18AM
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 <312841925@qq.com>
# 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
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Upstream: jump out of unnecessary loop after matching the status code.

Jim T 56 May 13, 2020 10:18AM

Re: Upstream: jump out of unnecessary loop after matching the status code.

Maxim Dounin 24 May 13, 2020 05:04PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 90
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready