aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_inet.h
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-10-26 11:43:32 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-10-26 11:43:32 +0000
commitbaf8e409bacae99139c46f85d2227acb9301e485 (patch)
tree74e68cb49372f3add5d7b32c9c60edec99625266 /src/core/ngx_inet.h
parent657b3b7f7dded18d6aaaa3d8a3b130509904dc9d (diff)
downloadnginx-baf8e409bacae99139c46f85d2227acb9301e485.tar.gz
nginx-baf8e409bacae99139c46f85d2227acb9301e485.zip
http listen unix domain sockets
Diffstat (limited to 'src/core/ngx_inet.h')
-rw-r--r--src/core/ngx_inet.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/core/ngx_inet.h b/src/core/ngx_inet.h
index 7562c9e80..c1e68c83b 100644
--- a/src/core/ngx_inet.h
+++ b/src/core/ngx_inet.h
@@ -12,21 +12,26 @@
#include <ngx_core.h>
-#define NGX_INET_ADDRSTRLEN (sizeof("255.255.255.255") - 1)
-#define NGX_INET6_ADDRSTRLEN \
- (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") - 1)
-
-#define NGX_SOCKADDR_STRLEN (NGX_INET6_ADDRSTRLEN + sizeof(":65535") - 1)
-
-
/*
- * TODO: autoconfigure NGX_SOCKADDRLEN as
+ * TODO: autoconfigure NGX_SOCKADDRLEN and NGX_SOCKADDR_STRLEN as
* sizeof(struct sockaddr_storage)
* sizeof(struct sockaddr_un)
* sizeof(struct sockaddr_in6)
* sizeof(struct sockaddr_in)
*/
+#define NGX_INET_ADDRSTRLEN (sizeof("255.255.255.255") - 1)
+#define NGX_INET6_ADDRSTRLEN \
+ (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") - 1)
+#define NGX_UNIX_ADDRSTRLEN \
+ (sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path))
+
+#if (NGX_HAVE_UNIX_DOMAIN)
+#define NGX_SOCKADDR_STRLEN (sizeof("unix:") - 1 + NGX_UNIX_ADDRSTRLEN)
+#else
+#define NGX_SOCKADDR_STRLEN (NGX_INET6_ADDRSTRLEN + sizeof(":65535") - 1)
+#endif
+
#if (NGX_HAVE_UNIX_DOMAIN)
#define NGX_SOCKADDRLEN sizeof(struct sockaddr_un)
#else