Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
831c87c1
Commit
831c87c1
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: Simplify netconn_resolve when using getaddrinfo.
parent
cc619639
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
net.c
dlls/winhttp/net.c
+10
-6
No files found.
dlls/winhttp/net.c
View file @
831c87c1
...
...
@@ -590,17 +590,21 @@ BOOL netconn_resolve( WCHAR *hostnameW, INTERNET_PORT port, struct sockaddr *sa,
TRACE
(
"failed to get address of %s (%s)
\n
"
,
debugstr_w
(
hostnameW
),
gai_strerror
(
ret
));
return
FALSE
;
}
if
(
*
sa_len
<
sizeof
(
struct
sockaddr_in
)
)
if
(
*
sa_len
<
res
->
ai_addrlen
)
{
WARN
(
"address too small
\n
"
);
freeaddrinfo
(
res
);
return
FALSE
;
}
*
sa_len
=
sizeof
(
struct
sockaddr_in
);
memset
(
sa
,
0
,
sizeof
(
struct
sockaddr_in
)
);
memcpy
(
&
((
struct
sockaddr_in
*
)
sa
)
->
sin_addr
,
&
((
struct
sockaddr_in
*
)
res
->
ai_addr
)
->
sin_addr
,
sizeof
(
struct
in_addr
)
);
((
struct
sockaddr_in
*
)
sa
)
->
sin_family
=
res
->
ai_family
;
((
struct
sockaddr_in
*
)
sa
)
->
sin_port
=
htons
(
port
);
*
sa_len
=
res
->
ai_addrlen
;
memcpy
(
sa
,
res
->
ai_addr
,
res
->
ai_addrlen
);
/* Copy port */
switch
(
res
->
ai_family
)
{
case
AF_INET
:
((
struct
sockaddr_in
*
)
sa
)
->
sin_port
=
htons
(
port
);
break
;
}
freeaddrinfo
(
res
);
#else
...
...
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