Created
July 30, 2020 02:30
-
-
Save kazeburo/01d1901eece9341aaaa92194ce1b4251 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur nginx-1.18.0.orig/src/http/ngx_http_upstream.c nginx-1.18.0/src/http/ngx_http_upstream.c | |
--- nginx-1.18.0.orig/src/http/ngx_http_upstream.c 2020-04-21 23:09:01.000000000 +0900 | |
+++ nginx-1.18.0/src/http/ngx_http_upstream.c 2020-07-30 11:28:08.000000000 +0900 | |
@@ -192,6 +192,8 @@ | |
ngx_http_upstream_t *u, ngx_connection_t *c); | |
#endif | |
+extern ngx_int_t ngx_http_upstream_dynamic_resolve_directive(ngx_conf_t *cf, | |
+ ngx_http_upstream_server_t *us, ngx_uint_t *i); | |
static ngx_http_upstream_header_t ngx_http_upstream_headers_in[] = { | |
@@ -5858,6 +5860,13 @@ | |
for (i = 2; i < cf->args->nelts; i++) { | |
+ ngx_int_t res = ngx_http_upstream_dynamic_resolve_directive(cf, us, &i); | |
+ if (res == NGX_ERROR) { | |
+ goto invalid; | |
+ } else if (res == NGX_AGAIN) { | |
+ continue; | |
+ } | |
+ | |
if (ngx_strncmp(value[i].data, "weight=", 7) == 0) { | |
if (!(uscf->flags & NGX_HTTP_UPSTREAM_WEIGHT)) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment