From 403e58f5f4e5f87dcd4d9f9bb8a11f25cf24c8a0 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Wed, 19 Oct 2005 19:07:08 +0000 Subject: [PATCH] Set the http port before figuring out whether we're using a proxy. --- dlls/wininet/http.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 95c9c3882bc..968b0fbf0fc 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -675,7 +675,6 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s',0}; DWORD len; INTERNET_ASYNC_RESULT iar; - INTERNET_PORT port; TRACE("--> \n"); @@ -757,6 +756,11 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, else HTTP_ProcessHeader(lpwhr, g_szHost, lpwhs->lpszServerName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDHDR_FLAG_REQ); + if (lpwhs->nServerPort == INTERNET_INVALID_PORT_NUMBER) + lpwhs->nServerPort = (dwFlags & INTERNET_FLAG_SECURE ? + INTERNET_DEFAULT_HTTPS_PORT : + INTERNET_DEFAULT_HTTP_PORT); + if (NULL != hIC->lpszProxy && hIC->lpszProxy[0] != 0) HTTP_DealWithProxy( hIC, lpwhs, lpwhr ); @@ -816,14 +820,8 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, INTERNET_STATUS_RESOLVING_NAME, lpwhs->lpszServerName, strlenW(lpwhs->lpszServerName)+1); - port = lpwhs->nServerPort; - if (port == INTERNET_INVALID_PORT_NUMBER) - port = (dwFlags & INTERNET_FLAG_SECURE ? - INTERNET_DEFAULT_HTTPS_PORT : - INTERNET_DEFAULT_HTTP_PORT); - - if (!GetAddress(lpwhs->lpszServerName, port, + if (!GetAddress(lpwhs->lpszServerName, lpwhs->nServerPort, &lpwhs->phostent, &lpwhs->socketAddress)) { INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED);