comparison src/core/ngx_inet.h @ 550:1dcf6adad484 NGINX_0_8_21

nginx 0.8.21 *) Feature: now the "-V" switch shows TLS SNI support. *) Feature: the "listen" directive of the HTTP module supports unix domain sockets. Thanks to Hongli Lai. *) Feature: the "default_server" parameter of the "listen" directive. *) Feature: now a "default" parameter is not required to set listen socket options. *) Bugfix: nginx did not support dates in 2038 year on 32-bit platforms; *) Bugfix: socket leak; the bug had appeared in 0.8.11.
author Igor Sysoev <http://sysoev.ru>
date Mon, 26 Oct 2009 00:00:00 +0300
parents 98143f74eb3d
children c04fa65fe604
comparison
equal deleted inserted replaced
549:3ca2e495d9de 550:1dcf6adad484
10 10
11 #include <ngx_config.h> 11 #include <ngx_config.h>
12 #include <ngx_core.h> 12 #include <ngx_core.h>
13 13
14 14
15 #define NGX_INET_ADDRSTRLEN (sizeof("255.255.255.255") - 1)
16 #define NGX_INET6_ADDRSTRLEN \
17 (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") - 1)
18
19 #define NGX_SOCKADDR_STRLEN (NGX_INET6_ADDRSTRLEN + sizeof(":65535") - 1)
20
21
22 /* 15 /*
23 * TODO: autoconfigure NGX_SOCKADDRLEN as 16 * TODO: autoconfigure NGX_SOCKADDRLEN and NGX_SOCKADDR_STRLEN as
24 * sizeof(struct sockaddr_storage) 17 * sizeof(struct sockaddr_storage)
25 * sizeof(struct sockaddr_un) 18 * sizeof(struct sockaddr_un)
26 * sizeof(struct sockaddr_in6) 19 * sizeof(struct sockaddr_in6)
27 * sizeof(struct sockaddr_in) 20 * sizeof(struct sockaddr_in)
28 */ 21 */
22
23 #define NGX_INET_ADDRSTRLEN (sizeof("255.255.255.255") - 1)
24 #define NGX_INET6_ADDRSTRLEN \
25 (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") - 1)
26 #define NGX_UNIX_ADDRSTRLEN \
27 (sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path))
28
29 #if (NGX_HAVE_UNIX_DOMAIN)
30 #define NGX_SOCKADDR_STRLEN (sizeof("unix:") - 1 + NGX_UNIX_ADDRSTRLEN)
31 #else
32 #define NGX_SOCKADDR_STRLEN (NGX_INET6_ADDRSTRLEN + sizeof(":65535") - 1)
33 #endif
29 34
30 #if (NGX_HAVE_UNIX_DOMAIN) 35 #if (NGX_HAVE_UNIX_DOMAIN)
31 #define NGX_SOCKADDRLEN sizeof(struct sockaddr_un) 36 #define NGX_SOCKADDRLEN sizeof(struct sockaddr_un)
32 #else 37 #else
33 #define NGX_SOCKADDRLEN 512 38 #define NGX_SOCKADDRLEN 512