From be932e81a1531a3ba032febad968fc2006c4fa48 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Mon, 21 Oct 2019 18:06:19 +0300 Subject: Core: moved PROXY protocol fields out of ngx_connection_t. Now a new structure ngx_proxy_protocol_t holds these fields. This allows to add more PROXY protocol fields in the future without modifying the connection structure. --- src/http/modules/ngx_http_realip_module.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/http/modules') diff --git a/src/http/modules/ngx_http_realip_module.c b/src/http/modules/ngx_http_realip_module.c index 7d3f2a91d..9586ebe07 100644 --- a/src/http/modules/ngx_http_realip_module.c +++ b/src/http/modules/ngx_http_realip_module.c @@ -180,12 +180,11 @@ ngx_http_realip_handler(ngx_http_request_t *r) case NGX_HTTP_REALIP_PROXY: - value = &r->connection->proxy_protocol_addr; - - if (value->len == 0) { + if (r->connection->proxy_protocol == NULL) { return NGX_DECLINED; } + value = &r->connection->proxy_protocol->src_addr; xfwd = NULL; break; @@ -238,7 +237,7 @@ found: != NGX_DECLINED) { if (rlcf->type == NGX_HTTP_REALIP_PROXY) { - ngx_inet_set_port(addr.sockaddr, c->proxy_protocol_port); + ngx_inet_set_port(addr.sockaddr, c->proxy_protocol->src_port); } return ngx_http_realip_set_addr(r, &addr); -- cgit