Mercurial > hg > nginx-vendor-0-8
comparison src/core/ngx_inet.c @ 538: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
537:3ca2e495d9de | 538:1dcf6adad484 |
---|---|
65 u_char *p; | 65 u_char *p; |
66 struct sockaddr_in *sin; | 66 struct sockaddr_in *sin; |
67 #if (NGX_HAVE_INET6) | 67 #if (NGX_HAVE_INET6) |
68 size_t n; | 68 size_t n; |
69 struct sockaddr_in6 *sin6; | 69 struct sockaddr_in6 *sin6; |
70 #endif | |
71 #if (NGX_HAVE_UNIX_DOMAIN) | |
72 struct sockaddr_un *saun; | |
70 #endif | 73 #endif |
71 | 74 |
72 switch (sa->sa_family) { | 75 switch (sa->sa_family) { |
73 | 76 |
74 case AF_INET: | 77 case AF_INET: |
104 n = ngx_sprintf(&text[1 + n], "]:%d", | 107 n = ngx_sprintf(&text[1 + n], "]:%d", |
105 ntohs(sin6->sin6_port)) - text; | 108 ntohs(sin6->sin6_port)) - text; |
106 } | 109 } |
107 | 110 |
108 return n; | 111 return n; |
112 #endif | |
113 | |
114 #if (NGX_HAVE_UNIX_DOMAIN) | |
115 | |
116 case AF_UNIX: | |
117 saun = (struct sockaddr_un *) sa; | |
118 | |
119 /* we do not include trailing zero in address length */ | |
120 | |
121 return ngx_snprintf(text, len, "unix:%s%Z", saun->sun_path) - text - 1; | |
122 | |
109 #endif | 123 #endif |
110 | 124 |
111 default: | 125 default: |
112 return 0; | 126 return 0; |
113 } | 127 } |