Commit 33d09e73 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wininet: Use struct sockaddr_storage in InternetCheckConnectionW.

parent f0dde6b6
...@@ -2749,16 +2749,16 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe ...@@ -2749,16 +2749,16 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe
if (dwFlags & FLAG_ICC_FORCE_CONNECTION) if (dwFlags & FLAG_ICC_FORCE_CONNECTION)
{ {
struct sockaddr_in sin; struct sockaddr_storage saddr;
socklen_t sa_len = sizeof(sin); socklen_t sa_len = sizeof(saddr);
int fd; int fd;
if (!GetAddress(hostW, port, (struct sockaddr *)&sin, &sa_len)) if (!GetAddress(hostW, port, (struct sockaddr *)&saddr, &sa_len))
goto End; goto End;
fd = socket(sin.sin_family, SOCK_STREAM, 0); fd = socket(saddr.ss_family, SOCK_STREAM, 0);
if (fd != -1) if (fd != -1)
{ {
if (connect(fd, (struct sockaddr *)&sin, sa_len) == 0) if (connect(fd, (struct sockaddr *)&saddr, sa_len) == 0)
rc = TRUE; rc = TRUE;
close(fd); close(fd);
} }
......
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