aboutsummaryrefslogtreecommitdiff
path: root/src/stream/ngx_stream_realip_module.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2019-10-21 18:06:19 +0300
committerRoman Arutyunyan <arut@nginx.com>2019-10-21 18:06:19 +0300
commitbe932e81a1531a3ba032febad968fc2006c4fa48 (patch)
tree582aff75a1bd2b436983740e6dfc76288047e31e /src/stream/ngx_stream_realip_module.c
parent0098761cb8636a6def144445082a0c90d340321c (diff)
downloadnginx-be932e81a1531a3ba032febad968fc2006c4fa48.tar.gz
nginx-be932e81a1531a3ba032febad968fc2006c4fa48.zip
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.
Diffstat (limited to 'src/stream/ngx_stream_realip_module.c')
-rw-r--r--src/stream/ngx_stream_realip_module.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/stream/ngx_stream_realip_module.c b/src/stream/ngx_stream_realip_module.c
index 57b1ac21e..603f5973b 100644
--- a/src/stream/ngx_stream_realip_module.c
+++ b/src/stream/ngx_stream_realip_module.c
@@ -108,7 +108,7 @@ ngx_stream_realip_handler(ngx_stream_session_t *s)
c = s->connection;
- if (c->proxy_protocol_addr.len == 0) {
+ if (c->proxy_protocol == NULL) {
return NGX_DECLINED;
}
@@ -116,14 +116,14 @@ ngx_stream_realip_handler(ngx_stream_session_t *s)
return NGX_DECLINED;
}
- if (ngx_parse_addr(c->pool, &addr, c->proxy_protocol_addr.data,
- c->proxy_protocol_addr.len)
+ if (ngx_parse_addr(c->pool, &addr, c->proxy_protocol->src_addr.data,
+ c->proxy_protocol->src_addr.len)
!= NGX_OK)
{
return NGX_DECLINED;
}
- ngx_inet_set_port(addr.sockaddr, c->proxy_protocol_port);
+ ngx_inet_set_port(addr.sockaddr, c->proxy_protocol->src_port);
return ngx_stream_realip_set_addr(s, &addr);
}