Skip to content

Commit

Permalink
IPv6 for Win32
Browse files Browse the repository at this point in the history
  • Loading branch information
igorsysoev committed May 7, 2009
1 parent 6ce6fcd commit dbc205a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions auto/os/win32
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ if [ $EVENT_SELECT = NO ]; then
EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE"
fi

if [ $NGX_IPV6 = YES ]; then
have=NGX_HAVE_INET6 . auto/have
fi

have=NGX_HAVE_AIO . auto/have
have=NGX_HAVE_IOCP . auto/have
14 changes: 14 additions & 0 deletions src/core/ngx_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,22 @@ ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u)

(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) {
Expand Down

0 comments on commit dbc205a

Please sign in to comment.