Changed setting default port number from HTTP_Connect to
HttpOpenRequestW.
This commit is contained in:
parent
6d6ca1e7c5
commit
e325f7ed82
|
@ -675,6 +675,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
|
||||||
static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s',0};
|
static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s',0};
|
||||||
DWORD len;
|
DWORD len;
|
||||||
INTERNET_ASYNC_RESULT iar;
|
INTERNET_ASYNC_RESULT iar;
|
||||||
|
INTERNET_PORT port;
|
||||||
|
|
||||||
TRACE("--> \n");
|
TRACE("--> \n");
|
||||||
|
|
||||||
|
@ -815,7 +816,14 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
|
||||||
INTERNET_STATUS_RESOLVING_NAME,
|
INTERNET_STATUS_RESOLVING_NAME,
|
||||||
lpwhs->lpszServerName,
|
lpwhs->lpszServerName,
|
||||||
strlenW(lpwhs->lpszServerName)+1);
|
strlenW(lpwhs->lpszServerName)+1);
|
||||||
if (!GetAddress(lpwhs->lpszServerName, lpwhs->nServerPort,
|
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,
|
||||||
&lpwhs->phostent, &lpwhs->socketAddress))
|
&lpwhs->phostent, &lpwhs->socketAddress))
|
||||||
{
|
{
|
||||||
INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED);
|
INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED);
|
||||||
|
@ -1834,9 +1842,6 @@ HINTERNET HTTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
|
||||||
* According to my tests. The name is not resolved until a request is sent
|
* According to my tests. The name is not resolved until a request is sent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (nServerPort == INTERNET_INVALID_PORT_NUMBER)
|
|
||||||
nServerPort = INTERNET_DEFAULT_HTTP_PORT;
|
|
||||||
|
|
||||||
lpwhs->hdr.htype = WH_HHTTPSESSION;
|
lpwhs->hdr.htype = WH_HHTTPSESSION;
|
||||||
lpwhs->hdr.lpwhparent = WININET_AddRef( &hIC->hdr );
|
lpwhs->hdr.lpwhparent = WININET_AddRef( &hIC->hdr );
|
||||||
lpwhs->hdr.dwFlags = dwFlags;
|
lpwhs->hdr.dwFlags = dwFlags;
|
||||||
|
|
Loading…
Reference in New Issue