Commit 481c9b89 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wininet: Support IPv6 addresses in HTTP_ResolveName and HTTP_OpenConnection.

parent 058e918d
......@@ -1448,9 +1448,13 @@ static BOOL HTTP_DealWithProxy( LPWININETAPPINFOW hIC,
return TRUE;
}
#ifndef INET6_ADDRSTRLEN
#define INET6_ADDRSTRLEN 46
#endif
static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr)
{
char szaddr[32];
char szaddr[INET6_ADDRSTRLEN];
LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession;
const void *addr;
......@@ -1472,6 +1476,9 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr)
case AF_INET:
addr = &((struct sockaddr_in *)&lpwhs->socketAddress)->sin_addr;
break;
case AF_INET6:
addr = &((struct sockaddr_in6 *)&lpwhs->socketAddress)->sin6_addr;
break;
default:
WARN("unsupported family %d\n", lpwhs->socketAddress.ss_family);
INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED);
......@@ -4117,7 +4124,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
BOOL bSuccess = FALSE;
LPWININETHTTPSESSIONW lpwhs;
LPWININETAPPINFOW hIC = NULL;
char szaddr[32];
char szaddr[INET6_ADDRSTRLEN];
const void *addr;
TRACE("-->\n");
......@@ -4144,6 +4151,9 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
case AF_INET:
addr = &((struct sockaddr_in *)&lpwhs->socketAddress)->sin_addr;
break;
case AF_INET6:
addr = &((struct sockaddr_in6 *)&lpwhs->socketAddress)->sin6_addr;
break;
default:
WARN("unsupported family %d\n", lpwhs->socketAddress.ss_family);
INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment