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
f0dde6b6
Commit
f0dde6b6
authored
Jul 09, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Jul 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Simplify GetAddress when using getaddrinfo.
parent
44bf0257
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
utility.c
dlls/wininet/utility.c
+9
-5
No files found.
dlls/wininet/utility.c
View file @
f0dde6b6
...
@@ -187,17 +187,21 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
...
@@ -187,17 +187,21 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
TRACE
(
"failed to get address of %s (%s)
\n
"
,
debugstr_w
(
lpszServerName
),
gai_strerror
(
ret
));
TRACE
(
"failed to get address of %s (%s)
\n
"
,
debugstr_w
(
lpszServerName
),
gai_strerror
(
ret
));
return
FALSE
;
return
FALSE
;
}
}
if
(
*
sa_len
<
sizeof
(
struct
sockaddr_in
)
)
if
(
*
sa_len
<
res
->
ai_addrlen
)
{
{
WARN
(
"address too small
\n
"
);
WARN
(
"address too small
\n
"
);
freeaddrinfo
(
res
);
freeaddrinfo
(
res
);
return
FALSE
;
return
FALSE
;
}
}
*
sa_len
=
sizeof
(
struct
sockaddr_in
);
*
sa_len
=
res
->
ai_addrlen
;
memset
(
psa
,
0
,
sizeof
(
struct
sockaddr_in
)
);
memcpy
(
psa
,
res
->
ai_addr
,
res
->
ai_addrlen
);
memcpy
(
&
((
struct
sockaddr_in
*
)
psa
)
->
sin_addr
,
&
((
struct
sockaddr_in
*
)
res
->
ai_addr
)
->
sin_addr
,
sizeof
(
struct
in_addr
)
);
/* Copy port */
((
struct
sockaddr_in
*
)
psa
)
->
sin_family
=
res
->
ai_family
;
switch
(
res
->
ai_family
)
{
case
AF_INET
:
((
struct
sockaddr_in
*
)
psa
)
->
sin_port
=
htons
(
nServerPort
);
((
struct
sockaddr_in
*
)
psa
)
->
sin_port
=
htons
(
nServerPort
);
break
;
}
freeaddrinfo
(
res
);
freeaddrinfo
(
res
);
#else
#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