diff options
Diffstat (limited to 'src/core/ngx_inet.c')
-rw-r--r-- | src/core/ngx_inet.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c index a5b137d94..3debac37e 100644 --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -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) { |