Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3d9809b1
Commit
3d9809b1
authored
Jul 08, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Jul 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Support IPv6 in netconn_resolve.
parent
d48eade7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
net.c
dlls/winhttp/net.c
+18
-4
No files found.
dlls/winhttp/net.c
View file @
3d9809b1
...
...
@@ -581,15 +581,25 @@ BOOL netconn_resolve( WCHAR *hostnameW, INTERNET_PORT port, struct sockaddr *sa,
#ifdef HAVE_GETADDRINFO
memset
(
&
hints
,
0
,
sizeof
(
struct
addrinfo
)
);
/* Prefer IPv4 to IPv6 addresses, since some web servers do not listen on
* their IPv6 addresses even though they have IPv6 addresses in the DNS.
*/
hints
.
ai_family
=
AF_INET
;
ret
=
getaddrinfo
(
hostname
,
NULL
,
&
hints
,
&
res
);
heap_free
(
hostname
);
if
(
ret
!=
0
)
{
TRACE
(
"failed to get address of %s (%s)
\n
"
,
debugstr_w
(
hostnameW
),
gai_strerror
(
ret
));
return
FALSE
;
TRACE
(
"failed to get IPv4 address of %s (%s), retrying with IPv6
\n
"
,
debugstr_w
(
hostnameW
),
gai_strerror
(
ret
));
hints
.
ai_family
=
AF_INET6
;
ret
=
getaddrinfo
(
hostname
,
NULL
,
&
hints
,
&
res
);
if
(
ret
!=
0
)
{
TRACE
(
"failed to get address of %s (%s)
\n
"
,
debugstr_w
(
hostnameW
),
gai_strerror
(
ret
));
heap_free
(
hostname
);
return
FALSE
;
}
}
heap_free
(
hostname
);
if
(
*
sa_len
<
res
->
ai_addrlen
)
{
WARN
(
"address too small
\n
"
);
...
...
@@ -604,9 +614,13 @@ BOOL netconn_resolve( WCHAR *hostnameW, INTERNET_PORT port, struct sockaddr *sa,
case
AF_INET
:
((
struct
sockaddr_in
*
)
sa
)
->
sin_port
=
htons
(
port
);
break
;
case
AF_INET6
:
((
struct
sockaddr_in6
*
)
sa
)
->
sin6_port
=
htons
(
port
);
break
;
}
freeaddrinfo
(
res
);
return
TRUE
;
#else
EnterCriticalSection
(
&
cs_gethostbyname
);
...
...
@@ -631,8 +645,8 @@ BOOL netconn_resolve( WCHAR *hostnameW, INTERNET_PORT port, struct sockaddr *sa,
sin
->
sin_port
=
htons
(
port
);
LeaveCriticalSection
(
&
cs_gethostbyname
);
#endif
return
TRUE
;
#endif
}
const
void
*
netconn_get_certificate
(
netconn_t
*
conn
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment