wininet: Use address length returned by GetAddress in NETCON_connect.
This commit is contained in:
parent
9f82d9c779
commit
c572e1c99a
|
@ -1452,16 +1452,15 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr)
|
||||||
{
|
{
|
||||||
char szaddr[32];
|
char szaddr[32];
|
||||||
LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession;
|
LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession;
|
||||||
socklen_t sa_len;
|
|
||||||
|
|
||||||
INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
|
INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
|
||||||
INTERNET_STATUS_RESOLVING_NAME,
|
INTERNET_STATUS_RESOLVING_NAME,
|
||||||
lpwhs->lpszServerName,
|
lpwhs->lpszServerName,
|
||||||
strlenW(lpwhs->lpszServerName)+1);
|
strlenW(lpwhs->lpszServerName)+1);
|
||||||
|
|
||||||
sa_len = sizeof(lpwhs->socketAddress);
|
lpwhs->sa_len = sizeof(lpwhs->socketAddress);
|
||||||
if (!GetAddress(lpwhs->lpszServerName, lpwhs->nServerPort,
|
if (!GetAddress(lpwhs->lpszServerName, lpwhs->nServerPort,
|
||||||
(struct sockaddr *)&lpwhs->socketAddress, &sa_len))
|
(struct sockaddr *)&lpwhs->socketAddress, &lpwhs->sa_len))
|
||||||
{
|
{
|
||||||
INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED);
|
INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -4144,7 +4143,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NETCON_connect(&lpwhr->netConnection, (struct sockaddr *)&lpwhs->socketAddress,
|
if (!NETCON_connect(&lpwhr->netConnection, (struct sockaddr *)&lpwhs->socketAddress,
|
||||||
sizeof(lpwhs->socketAddress)))
|
lpwhs->sa_len))
|
||||||
goto lend;
|
goto lend;
|
||||||
|
|
||||||
if (lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE)
|
if (lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE)
|
||||||
|
|
|
@ -166,6 +166,7 @@ typedef struct
|
||||||
INTERNET_PORT nHostPort; /* the final destination port of the request */
|
INTERNET_PORT nHostPort; /* the final destination port of the request */
|
||||||
INTERNET_PORT nServerPort; /* the port of the server we directly connect to */
|
INTERNET_PORT nServerPort; /* the port of the server we directly connect to */
|
||||||
struct sockaddr_in socketAddress;
|
struct sockaddr_in socketAddress;
|
||||||
|
socklen_t sa_len;
|
||||||
} WININETHTTPSESSIONW, *LPWININETHTTPSESSIONW;
|
} WININETHTTPSESSIONW, *LPWININETHTTPSESSIONW;
|
||||||
|
|
||||||
#define HDR_ISREQUEST 0x0001
|
#define HDR_ISREQUEST 0x0001
|
||||||
|
|
Loading…
Reference in New Issue