wininet: Resolve hostname once per connection.
This commit is contained in:
parent
34ff555cf9
commit
6233704481
|
@ -1329,6 +1329,8 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr)
|
|||
char szaddr[32];
|
||||
LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession;
|
||||
|
||||
if (lpwhs->socketAddress.sin_addr.s_addr) return TRUE;
|
||||
|
||||
INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
|
||||
INTERNET_STATUS_RESOLVING_NAME,
|
||||
lpwhs->lpszServerName,
|
||||
|
@ -2016,16 +2018,6 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
|
|||
INTERNET_STATUS_HANDLE_CREATED, &handle,
|
||||
sizeof(handle));
|
||||
|
||||
/*
|
||||
* A STATUS_REQUEST_COMPLETE is NOT sent here as per my tests on windows
|
||||
*/
|
||||
|
||||
if (!HTTP_ResolveName(lpwhr))
|
||||
{
|
||||
InternetCloseHandle( handle );
|
||||
handle = NULL;
|
||||
}
|
||||
|
||||
lend:
|
||||
if( lpwhr )
|
||||
WININET_Release( &lpwhr->hdr );
|
||||
|
@ -3600,6 +3592,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
|
|||
bSuccess = TRUE;
|
||||
goto lend;
|
||||
}
|
||||
if (!HTTP_ResolveName(lpwhr)) goto lend;
|
||||
|
||||
lpwhs = lpwhr->lpHttpSession;
|
||||
|
||||
|
|
|
@ -270,8 +270,6 @@ static void InternetReadFile_test(int flags)
|
|||
|
||||
CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED);
|
||||
SET_EXPECT(INTERNET_STATUS_HANDLE_CREATED);
|
||||
SET_WINE_ALLOW(INTERNET_STATUS_RESOLVING_NAME);
|
||||
SET_WINE_ALLOW(INTERNET_STATUS_NAME_RESOLVED);
|
||||
|
||||
trace("HttpOpenRequestA <--\n");
|
||||
hor = HttpOpenRequestA(hic, "GET", "/about/", NULL, NULL, types,
|
||||
|
@ -297,11 +295,8 @@ static void InternetReadFile_test(int flags)
|
|||
ok(!strcmp(buffer, "http://www.winehq.org/about/"), "Wrong URL %s\n", buffer);
|
||||
|
||||
CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED);
|
||||
todo_wine
|
||||
{
|
||||
CHECK_NOT_NOTIFIED(INTERNET_STATUS_RESOLVING_NAME);
|
||||
CHECK_NOT_NOTIFIED(INTERNET_STATUS_NAME_RESOLVED);
|
||||
}
|
||||
CHECK_NOT_NOTIFIED(INTERNET_STATUS_RESOLVING_NAME);
|
||||
CHECK_NOT_NOTIFIED(INTERNET_STATUS_NAME_RESOLVED);
|
||||
if (first_connection_to_test_url)
|
||||
{
|
||||
SET_EXPECT(INTERNET_STATUS_RESOLVING_NAME);
|
||||
|
@ -516,8 +511,6 @@ static void InternetReadFileExA_test(int flags)
|
|||
|
||||
CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED);
|
||||
SET_EXPECT(INTERNET_STATUS_HANDLE_CREATED);
|
||||
SET_WINE_ALLOW(INTERNET_STATUS_RESOLVING_NAME);
|
||||
SET_WINE_ALLOW(INTERNET_STATUS_NAME_RESOLVED);
|
||||
|
||||
trace("HttpOpenRequestA <--\n");
|
||||
hor = HttpOpenRequestA(hic, "GET", "/about/", NULL, NULL, types,
|
||||
|
@ -538,11 +531,8 @@ static void InternetReadFileExA_test(int flags)
|
|||
if (hor == 0x0) goto abort;
|
||||
|
||||
CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED);
|
||||
todo_wine
|
||||
{
|
||||
CHECK_NOT_NOTIFIED(INTERNET_STATUS_RESOLVING_NAME);
|
||||
CHECK_NOT_NOTIFIED(INTERNET_STATUS_NAME_RESOLVED);
|
||||
}
|
||||
CHECK_NOT_NOTIFIED(INTERNET_STATUS_RESOLVING_NAME);
|
||||
CHECK_NOT_NOTIFIED(INTERNET_STATUS_NAME_RESOLVED);
|
||||
if (first_connection_to_test_url)
|
||||
{
|
||||
SET_EXPECT(INTERNET_STATUS_RESOLVING_NAME);
|
||||
|
|
Loading…
Reference in New Issue