wininet: Don't strip port part from server name in GetAddress.

Callers take care of that already.
This commit is contained in:
Jacek Caban 2015-02-16 11:16:16 +01:00 committed by Alexandre Julliard
parent 50c2144999
commit 11d09f1fe7

View File

@ -129,27 +129,15 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
struct sockaddr *psa, socklen_t *sa_len)
{
struct addrinfo *res, hints;
WCHAR *found;
char *name;
int len, sz;
int sz;
int ret;
TRACE("%s\n", debugstr_w(lpszServerName));
/* Validate server name first
* Check if there is something like
* pinger.macromedia.com:80
* if yes, eliminate the :80....
*/
found = strchrW(lpszServerName, ':');
if (found)
len = found - lpszServerName;
else
len = strlenW(lpszServerName);
sz = WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, NULL, 0, NULL, NULL );
sz = WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, -1, NULL, 0, NULL, NULL );
if (!(name = heap_alloc(sz + 1))) return FALSE;
WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, name, sz, NULL, NULL );
WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, -1, name, sz, NULL, NULL );
name[sz] = 0;
memset( &hints, 0, sizeof(hints) );