diff src/core/ngx_inet.c @ 488:829f9a66a659 NGINX_0_7_56

nginx 0.7.56 *) Feature: nginx/Windows supports IPv6 in a "listen" directive of the HTTP module. *) Bugfix: in ngx_http_image_filter_module.
author Igor Sysoev <http://sysoev.ru>
date Mon, 11 May 2009 00:00:00 +0400
parents a8424ffa495c
children 98143f74eb3d
line wrap: on
line diff
--- a/src/core/ngx_inet.c
+++ b/src/core/ngx_inet.c
@@ -649,8 +649,22 @@ ngx_parse_inet6_url(ngx_pool_t *pool, ng
 
     (void) ngx_cpystrn(p, host, len);
 
+#if (NGX_WIN32)
+
+    rc = WSAStringToAddress((char *) p, AF_INET6, NULL,
+                            (SOCKADDR *) sin6, &u->socklen);
+    rc = !rc;
+
+    if (u->port) {
+        sin6->sin6_port = htons(u->port);
+    }
+
+#else
+
     rc = inet_pton(AF_INET6, (const char *) p, &sin6->sin6_addr);
 
+#endif
+
     ngx_free(p);
 
     if (rc == 0) {