aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/ngx_connection.c6
-rw-r--r--src/http/ngx_http_variables.c12
2 files changed, 18 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;
diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c
index e49d2023b..8b86d5a9a 100644
--- a/src/http/ngx_http_variables.c
+++ b/src/http/ngx_http_variables.c
@@ -1185,6 +1185,12 @@ ngx_http_variable_remote_port(ngx_http_request_t *r,
break;
#endif
+#if (NGX_HAVE_UNIX_DOMAIN)
+ case AF_UNIX:
+ port = 0;
+ break;
+#endif
+
default: /* AF_INET */
sin = (struct sockaddr_in *) r->connection->sockaddr;
port = ntohs(sin->sin_port);
@@ -1263,6 +1269,12 @@ ngx_http_variable_server_port(ngx_http_request_t *r,
break;
#endif
+#if (NGX_HAVE_UNIX_DOMAIN)
+ case AF_UNIX:
+ port = 0;
+ break;
+#endif
+
default: /* AF_INET */
sin = (struct sockaddr_in *) r->connection->local_sockaddr;
port = ntohs(sin->sin_port);