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, ...@@ -1448,9 +1448,13 @@ static BOOL HTTP_DealWithProxy( LPWININETAPPINFOW hIC,
return TRUE; return TRUE;
} }
#ifndef INET6_ADDRSTRLEN
#define INET6_ADDRSTRLEN 46
#endif
static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr) static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr)
{ {
char szaddr[32]; char szaddr[INET6_ADDRSTRLEN];
LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession; LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession;
const void *addr; const void *addr;
...@@ -1472,6 +1476,9 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr) ...@@ -1472,6 +1476,9 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr)
case AF_INET: case AF_INET:
addr = &((struct sockaddr_in *)&lpwhs->socketAddress)->sin_addr; addr = &((struct sockaddr_in *)&lpwhs->socketAddress)->sin_addr;
break; break;
case AF_INET6:
addr = &((struct sockaddr_in6 *)&lpwhs->socketAddress)->sin6_addr;
break;
default: default:
WARN("unsupported family %d\n", lpwhs->socketAddress.ss_family); WARN("unsupported family %d\n", lpwhs->socketAddress.ss_family);
INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED); INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED);
...@@ -4117,7 +4124,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr) ...@@ -4117,7 +4124,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETHTTPSESSIONW lpwhs; LPWININETHTTPSESSIONW lpwhs;
LPWININETAPPINFOW hIC = NULL; LPWININETAPPINFOW hIC = NULL;
char szaddr[32]; char szaddr[INET6_ADDRSTRLEN];
const void *addr; const void *addr;
TRACE("-->\n"); TRACE("-->\n");
...@@ -4144,6 +4151,9 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr) ...@@ -4144,6 +4151,9 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
case AF_INET: case AF_INET:
addr = &((struct sockaddr_in *)&lpwhs->socketAddress)->sin_addr; addr = &((struct sockaddr_in *)&lpwhs->socketAddress)->sin_addr;
break; break;
case AF_INET6:
addr = &((struct sockaddr_in6 *)&lpwhs->socketAddress)->sin6_addr;
break;
default: default:
WARN("unsupported family %d\n", lpwhs->socketAddress.ss_family); WARN("unsupported family %d\n", lpwhs->socketAddress.ss_family);
INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED); 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