Commit 62337044 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wininet: Resolve hostname once per connection.

parent 34ff555c
...@@ -1329,6 +1329,8 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr) ...@@ -1329,6 +1329,8 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr)
char szaddr[32]; char szaddr[32];
LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession; LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession;
if (lpwhs->socketAddress.sin_addr.s_addr) return TRUE;
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,
...@@ -2016,16 +2018,6 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, ...@@ -2016,16 +2018,6 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
INTERNET_STATUS_HANDLE_CREATED, &handle, INTERNET_STATUS_HANDLE_CREATED, &handle,
sizeof(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: lend:
if( lpwhr ) if( lpwhr )
WININET_Release( &lpwhr->hdr ); WININET_Release( &lpwhr->hdr );
...@@ -3600,6 +3592,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr) ...@@ -3600,6 +3592,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
bSuccess = TRUE; bSuccess = TRUE;
goto lend; goto lend;
} }
if (!HTTP_ResolveName(lpwhr)) goto lend;
lpwhs = lpwhr->lpHttpSession; lpwhs = lpwhr->lpHttpSession;
......
...@@ -270,8 +270,6 @@ static void InternetReadFile_test(int flags) ...@@ -270,8 +270,6 @@ static void InternetReadFile_test(int flags)
CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED); CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED);
SET_EXPECT(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"); trace("HttpOpenRequestA <--\n");
hor = HttpOpenRequestA(hic, "GET", "/about/", NULL, NULL, types, hor = HttpOpenRequestA(hic, "GET", "/about/", NULL, NULL, types,
...@@ -297,11 +295,8 @@ static void InternetReadFile_test(int flags) ...@@ -297,11 +295,8 @@ static void InternetReadFile_test(int flags)
ok(!strcmp(buffer, "http://www.winehq.org/about/"), "Wrong URL %s\n", buffer); ok(!strcmp(buffer, "http://www.winehq.org/about/"), "Wrong URL %s\n", buffer);
CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED); 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) if (first_connection_to_test_url)
{ {
SET_EXPECT(INTERNET_STATUS_RESOLVING_NAME); SET_EXPECT(INTERNET_STATUS_RESOLVING_NAME);
...@@ -516,8 +511,6 @@ static void InternetReadFileExA_test(int flags) ...@@ -516,8 +511,6 @@ static void InternetReadFileExA_test(int flags)
CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED); CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED);
SET_EXPECT(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"); trace("HttpOpenRequestA <--\n");
hor = HttpOpenRequestA(hic, "GET", "/about/", NULL, NULL, types, hor = HttpOpenRequestA(hic, "GET", "/about/", NULL, NULL, types,
...@@ -538,11 +531,8 @@ static void InternetReadFileExA_test(int flags) ...@@ -538,11 +531,8 @@ static void InternetReadFileExA_test(int flags)
if (hor == 0x0) goto abort; if (hor == 0x0) goto abort;
CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED); 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) if (first_connection_to_test_url)
{ {
SET_EXPECT(INTERNET_STATUS_RESOLVING_NAME); SET_EXPECT(INTERNET_STATUS_RESOLVING_NAME);
......
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