diff options
author | Ruslan Ermilov <ru@nginx.com> | 2013-12-09 10:16:44 +0400 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2013-12-09 10:16:44 +0400 |
commit | fa512fdb7650b48826ef49754328980a6e357c9a (patch) | |
tree | 0687d9effe4f62626c583f4a8fd8326bdd817240 /src/core/ngx_connection.c | |
parent | 675e73e3bd70af7780ed8c9dde47d2d28a8a9f56 (diff) |
Fixed handling of UNIX-domain sockets.
When evaluating $local_port, $server_port, and $server_addr,
UNIX-domain sockets were mistakenly interpreted as IPv4 sockets.
Diffstat (limited to 'src/core/ngx_connection.c')
-rw-r--r-- | src/core/ngx_connection.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c index 4d73eb3e0..57e26912d 100644 --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -1095,6 +1095,12 @@ ngx_connection_local_sockaddr(ngx_connection_t *c, ngx_str_t *s, break; #endif +#if (NGX_HAVE_UNIX_DOMAIN) + case AF_UNIX: + addr = 1; + break; +#endif + default: /* AF_INET */ sin = (struct sockaddr_in *) c->local_sockaddr; addr = sin->sin_addr.s_addr; |