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
44bf0257
Commit
44bf0257
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: Change type of GetAddress from struct sockaddr_in * to struct sockaddr *.
parent
9fd8462a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
13 deletions
+33
-13
ftp.c
dlls/wininet/ftp.c
+3
-1
http.c
dlls/wininet/http.c
+3
-1
internet.c
dlls/wininet/internet.c
+3
-2
internet.h
dlls/wininet/internet.h
+1
-1
utility.c
dlls/wininet/utility.c
+23
-8
No files found.
dlls/wininet/ftp.c
View file @
44bf0257
...
...
@@ -2439,7 +2439,9 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
SendAsyncCallback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_RESOLVING_NAME
,
(
LPWSTR
)
lpszServerName
,
strlenW
(
lpszServerName
));
if
(
!
GetAddress
(
lpszServerName
,
nServerPort
,
&
socketAddr
))
sock_namelen
=
sizeof
(
socketAddr
);
if
(
!
GetAddress
(
lpszServerName
,
nServerPort
,
(
struct
sockaddr
*
)
&
socketAddr
,
&
sock_namelen
))
{
INTERNET_SetLastError
(
ERROR_INTERNET_NAME_NOT_RESOLVED
);
goto
lerror
;
...
...
dlls/wininet/http.c
View file @
44bf0257
...
...
@@ -1452,14 +1452,16 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr)
{
char
szaddr
[
32
];
LPWININETHTTPSESSIONW
lpwhs
=
lpwhr
->
lpHttpSession
;
socklen_t
sa_len
;
INTERNET_SendCallback
(
&
lpwhr
->
hdr
,
lpwhr
->
hdr
.
dwContext
,
INTERNET_STATUS_RESOLVING_NAME
,
lpwhs
->
lpszServerName
,
strlenW
(
lpwhs
->
lpszServerName
)
+
1
);
sa_len
=
sizeof
(
lpwhs
->
socketAddress
);
if
(
!
GetAddress
(
lpwhs
->
lpszServerName
,
lpwhs
->
nServerPort
,
&
lpwhs
->
socketAddress
))
(
struct
sockaddr
*
)
&
lpwhs
->
socketAddress
,
&
sa_len
))
{
INTERNET_SetLastError
(
ERROR_INTERNET_NAME_NOT_RESOLVED
);
return
FALSE
;
...
...
dlls/wininet/internet.c
View file @
44bf0257
...
...
@@ -2750,14 +2750,15 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe
if
(
dwFlags
&
FLAG_ICC_FORCE_CONNECTION
)
{
struct
sockaddr_in
sin
;
socklen_t
sa_len
=
sizeof
(
sin
);
int
fd
;
if
(
!
GetAddress
(
hostW
,
port
,
&
si
n
))
if
(
!
GetAddress
(
hostW
,
port
,
(
struct
sockaddr
*
)
&
sin
,
&
sa_le
n
))
goto
End
;
fd
=
socket
(
sin
.
sin_family
,
SOCK_STREAM
,
0
);
if
(
fd
!=
-
1
)
{
if
(
connect
(
fd
,
(
struct
sockaddr
*
)
&
sin
,
s
izeof
(
sin
)
)
==
0
)
if
(
connect
(
fd
,
(
struct
sockaddr
*
)
&
sin
,
s
a_len
)
==
0
)
rc
=
TRUE
;
close
(
fd
);
}
...
...
dlls/wininet/internet.h
View file @
44bf0257
...
...
@@ -381,7 +381,7 @@ HINTERNET HTTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
DWORD
dwInternalFlags
);
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
struct
sockaddr
_in
*
psa
);
struct
sockaddr
*
psa
,
socklen_t
*
sa_len
);
void
INTERNET_SetLastError
(
DWORD
dwError
);
DWORD
INTERNET_GetLastError
(
void
);
...
...
dlls/wininet/utility.c
View file @
44bf0257
...
...
@@ -145,7 +145,7 @@ time_t ConvertTimeString(LPCWSTR asctime)
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
struct
sockaddr
_in
*
psa
)
struct
sockaddr
*
psa
,
socklen_t
*
sa_len
)
{
WCHAR
*
found
;
char
*
name
;
...
...
@@ -155,6 +155,7 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
int
ret
;
#else
struct
hostent
*
phe
;
struct
sockaddr_in
*
sin
=
(
struct
sockaddr_in
*
)
psa
;
#endif
TRACE
(
"%s
\n
"
,
debugstr_w
(
lpszServerName
));
...
...
@@ -186,10 +187,17 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
TRACE
(
"failed to get address of %s (%s)
\n
"
,
debugstr_w
(
lpszServerName
),
gai_strerror
(
ret
));
return
FALSE
;
}
if
(
*
sa_len
<
sizeof
(
struct
sockaddr_in
))
{
WARN
(
"address too small
\n
"
);
freeaddrinfo
(
res
);
return
FALSE
;
}
*
sa_len
=
sizeof
(
struct
sockaddr_in
);
memset
(
psa
,
0
,
sizeof
(
struct
sockaddr_in
)
);
memcpy
(
&
psa
->
sin_addr
,
&
((
struct
sockaddr_in
*
)
res
->
ai_addr
)
->
sin_addr
,
sizeof
(
struct
in_addr
)
);
psa
->
sin_family
=
res
->
ai_family
;
psa
->
sin_port
=
htons
(
nServerPort
);
memcpy
(
&
((
struct
sockaddr_in
*
)
psa
)
->
sin_addr
,
&
((
struct
sockaddr_in
*
)
res
->
ai_addr
)
->
sin_addr
,
sizeof
(
struct
in_addr
)
);
((
struct
sockaddr_in
*
)
psa
)
->
sin_family
=
res
->
ai_family
;
((
struct
sockaddr_in
*
)
psa
)
->
sin_port
=
htons
(
nServerPort
);
freeaddrinfo
(
res
);
#else
...
...
@@ -203,10 +211,17 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
LeaveCriticalSection
(
&
cs_gethostbyname
);
return
FALSE
;
}
memset
(
psa
,
0
,
sizeof
(
struct
sockaddr_in
));
memcpy
((
char
*
)
&
psa
->
sin_addr
,
phe
->
h_addr
,
phe
->
h_length
);
psa
->
sin_family
=
phe
->
h_addrtype
;
psa
->
sin_port
=
htons
(
nServerPort
);
if
(
*
sa_len
<
sizeof
(
struct
sockaddr_in
))
{
WARN
(
"address too small
\n
"
);
LeaveCriticalSection
(
&
cs_gethostbyname
);
return
FALSE
;
}
*
sa_len
=
sizeof
(
struct
sockaddr_in
);
memset
(
sin
,
0
,
sizeof
(
struct
sockaddr_in
));
memcpy
((
char
*
)
&
sin
->
sin_addr
,
phe
->
h_addr
,
phe
->
h_length
);
sin
->
sin_family
=
phe
->
h_addrtype
;
sin
->
sin_port
=
htons
(
nServerPort
);
LeaveCriticalSection
(
&
cs_gethostbyname
);
#endif
...
...
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