Commit 228c0608 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Get rid of INTERNET_INVALID_PORT_NUMBER fixups after InternetCrackUrl calls.

parent dfa014a5
...@@ -1792,7 +1792,6 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *session, http_req ...@@ -1792,7 +1792,6 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *session, http_req
URL_COMPONENTSW UrlComponents = { sizeof(UrlComponents) }; URL_COMPONENTSW UrlComponents = { sizeof(UrlComponents) };
server_t *new_server = NULL; server_t *new_server = NULL;
WCHAR *proxy; WCHAR *proxy;
BOOL is_https;
proxy = INTERNET_FindProxyForProtocol(hIC->proxy, protoHttp); proxy = INTERNET_FindProxyForProtocol(hIC->proxy, protoHttp);
if(!proxy) if(!proxy)
...@@ -1813,12 +1812,8 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *session, http_req ...@@ -1813,12 +1812,8 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *session, http_req
if( !request->path ) if( !request->path )
request->path = szNul; request->path = szNul;
is_https = (UrlComponents.nScheme == INTERNET_SCHEME_HTTPS);
if (is_https && UrlComponents.nPort == INTERNET_INVALID_PORT_NUMBER)
UrlComponents.nPort = INTERNET_DEFAULT_HTTPS_PORT;
new_server = get_server(substr(UrlComponents.lpszHostName, UrlComponents.dwHostNameLength), new_server = get_server(substr(UrlComponents.lpszHostName, UrlComponents.dwHostNameLength),
UrlComponents.nPort, is_https, TRUE); UrlComponents.nPort, UrlComponents.nScheme == INTERNET_SCHEME_HTTPS, TRUE);
} }
heap_free(proxy); heap_free(proxy);
if(!new_server) if(!new_server)
...@@ -4171,10 +4166,7 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, LPCWSTR lpszUrl) ...@@ -4171,10 +4166,7 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, LPCWSTR lpszUrl)
request->hdr.dwFlags &= ~INTERNET_FLAG_SECURE; request->hdr.dwFlags &= ~INTERNET_FLAG_SECURE;
} }
if(urlComponents.nPort == INTERNET_INVALID_PORT_NUMBER) custom_port = urlComponents.nPort != INTERNET_DEFAULT_HTTP_PORT;
urlComponents.nPort = INTERNET_DEFAULT_HTTP_PORT;
else if(urlComponents.nPort != INTERNET_DEFAULT_HTTP_PORT)
custom_port = TRUE;
}else if(!strcmpiW(protocol, httpsW)) { }else if(!strcmpiW(protocol, httpsW)) {
if(!(request->hdr.dwFlags & INTERNET_FLAG_SECURE)) { if(!(request->hdr.dwFlags & INTERNET_FLAG_SECURE)) {
TRACE("redirect from non-secure page to secure page\n"); TRACE("redirect from non-secure page to secure page\n");
...@@ -4182,10 +4174,7 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, LPCWSTR lpszUrl) ...@@ -4182,10 +4174,7 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, LPCWSTR lpszUrl)
request->hdr.dwFlags |= INTERNET_FLAG_SECURE; request->hdr.dwFlags |= INTERNET_FLAG_SECURE;
} }
if(urlComponents.nPort == INTERNET_INVALID_PORT_NUMBER) custom_port = urlComponents.nPort != INTERNET_DEFAULT_HTTPS_PORT;
urlComponents.nPort = INTERNET_DEFAULT_HTTPS_PORT;
else if(urlComponents.nPort != INTERNET_DEFAULT_HTTPS_PORT)
custom_port = TRUE;
} }
heap_free(session->hostName); heap_free(session->hostName);
......
...@@ -3477,8 +3477,6 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl, ...@@ -3477,8 +3477,6 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
switch(urlComponents.nScheme) { switch(urlComponents.nScheme) {
case INTERNET_SCHEME_FTP: case INTERNET_SCHEME_FTP:
if(urlComponents.nPort == 0)
urlComponents.nPort = INTERNET_DEFAULT_FTP_PORT;
client = FTP_Connect(hIC, host, urlComponents.nPort, client = FTP_Connect(hIC, host, urlComponents.nPort,
user, pass, dwFlags, dwContext, INET_OPENURL); user, pass, dwFlags, dwContext, INET_OPENURL);
if(client == NULL) if(client == NULL)
...@@ -3494,12 +3492,7 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl, ...@@ -3494,12 +3492,7 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
case INTERNET_SCHEME_HTTPS: { case INTERNET_SCHEME_HTTPS: {
static const WCHAR szStars[] = { '*','/','*', 0 }; static const WCHAR szStars[] = { '*','/','*', 0 };
LPCWSTR accept[2] = { szStars, NULL }; LPCWSTR accept[2] = { szStars, NULL };
if(urlComponents.nPort == 0) {
if(urlComponents.nScheme == INTERNET_SCHEME_HTTP)
urlComponents.nPort = INTERNET_DEFAULT_HTTP_PORT;
else
urlComponents.nPort = INTERNET_DEFAULT_HTTPS_PORT;
}
if (urlComponents.nScheme == INTERNET_SCHEME_HTTPS) dwFlags |= INTERNET_FLAG_SECURE; if (urlComponents.nScheme == INTERNET_SCHEME_HTTPS) dwFlags |= INTERNET_FLAG_SECURE;
/* FIXME: should use pointers, not handles, as handles are not thread-safe */ /* FIXME: should use pointers, not handles, as handles are not thread-safe */
......
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