From b70abc5241a1d07541bf4e15f4aa6af515b29538 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Thu, 22 Sep 2016 19:32:26 +0300 Subject: [PATCH] Upstream: introduced u->upstream. It holds upstream{} block configuration, including ones selected via run-time lookup using variables. --- src/http/ngx_http_upstream.c | 2 ++ src/http/ngx_http_upstream.h | 1 + src/stream/ngx_stream_proxy_module.c | 2 ++ src/stream/ngx_stream_upstream.h | 1 + 4 files changed, 6 insertions(+) diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 8ddc4e3e9..b8bf3f656 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -748,6 +748,8 @@ found: return; } + u->upstream = uscf; + #if (NGX_HTTP_SSL) u->ssl_name = uscf->host; #endif diff --git a/src/http/ngx_http_upstream.h b/src/http/ngx_http_upstream.h index ef861f4ab..397c8d574 100644 --- a/src/http/ngx_http_upstream.h +++ b/src/http/ngx_http_upstream.h @@ -313,6 +313,7 @@ struct ngx_http_upstream_s { ngx_chain_writer_ctx_t writer; ngx_http_upstream_conf_t *conf; + ngx_http_upstream_srv_conf_t *upstream; #if (NGX_HTTP_CACHE) ngx_array_t *caches; #endif diff --git a/src/stream/ngx_stream_proxy_module.c b/src/stream/ngx_stream_proxy_module.c index 2e9047192..4231f97f7 100644 --- a/src/stream/ngx_stream_proxy_module.c +++ b/src/stream/ngx_stream_proxy_module.c @@ -521,6 +521,8 @@ found: return; } + u->upstream = uscf; + #if (NGX_STREAM_SSL) u->ssl_name = uscf->host; #endif diff --git a/src/stream/ngx_stream_upstream.h b/src/stream/ngx_stream_upstream.h index c97aacef1..1e9f08fc6 100644 --- a/src/stream/ngx_stream_upstream.h +++ b/src/stream/ngx_stream_upstream.h @@ -124,6 +124,7 @@ typedef struct { ngx_str_t ssl_name; #endif + ngx_stream_upstream_srv_conf_t *upstream; ngx_stream_upstream_resolved_t *resolved; ngx_stream_upstream_state_t *state; unsigned connected:1;