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
47778f95
Commit
47778f95
authored
Feb 16, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Moved inet_ntop call to GetAddress.
parent
100bd11a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
23 deletions
+12
-23
ftp.c
dlls/wininet/ftp.c
+2
-3
http.c
dlls/wininet/http.c
+2
-16
internet.c
dlls/wininet/internet.c
+1
-1
internet.h
dlls/wininet/internet.h
+1
-2
utility.c
dlls/wininet/utility.c
+6
-1
No files found.
dlls/wininet/ftp.c
View file @
47778f95
...
...
@@ -2447,7 +2447,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
socklen_t
sock_namelen
;
BOOL
bSuccess
=
FALSE
;
ftp_session_t
*
lpwfs
=
NULL
;
char
szaddr
[
INET_ADDRSTRLEN
];
char
szaddr
[
INET
6
_ADDRSTRLEN
];
TRACE
(
"%p Server(%s) Port(%d) User(%s) Paswd(%s)
\n
"
,
hIC
,
debugstr_w
(
lpszServerName
),
...
...
@@ -2535,7 +2535,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
(
LPWSTR
)
lpszServerName
,
(
strlenW
(
lpszServerName
)
+
1
)
*
sizeof
(
WCHAR
));
sock_namelen
=
sizeof
(
socketAddr
);
if
(
!
GetAddress
(
lpszServerName
,
lpwfs
->
serverport
,
(
struct
sockaddr
*
)
&
socketAddr
,
&
sock_namelen
))
if
(
!
GetAddress
(
lpszServerName
,
lpwfs
->
serverport
,
(
struct
sockaddr
*
)
&
socketAddr
,
&
sock_namelen
,
szaddr
))
{
INTERNET_SetLastError
(
ERROR_INTERNET_NAME_NOT_RESOLVED
);
goto
lerror
;
...
...
@@ -2548,7 +2548,6 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
goto
lerror
;
}
inet_ntop
(
socketAddr
.
sin_family
,
&
socketAddr
.
sin_addr
,
szaddr
,
sizeof
(
szaddr
));
SendAsyncCallback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_NAME_RESOLVED
,
szaddr
,
strlen
(
szaddr
)
+
1
);
...
...
dlls/wininet/http.c
View file @
47778f95
...
...
@@ -1852,8 +1852,7 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *session, http_req
static
DWORD
HTTP_ResolveName
(
http_request_t
*
request
)
{
server_t
*
server
=
request
->
proxy
?
request
->
proxy
:
request
->
server
;
socklen_t
addr_len
;
void
*
addr
;
int
addr_len
;
if
(
server
->
addr_len
)
return
ERROR_SUCCESS
;
...
...
@@ -1864,23 +1863,10 @@ static DWORD HTTP_ResolveName(http_request_t *request)
(
strlenW
(
server
->
name
)
+
1
)
*
sizeof
(
WCHAR
));
addr_len
=
sizeof
(
server
->
addr
);
if
(
!
GetAddress
(
server
->
name
,
server
->
port
,
(
struct
sockaddr
*
)
&
server
->
addr
,
&
addr_len
))
if
(
!
GetAddress
(
server
->
name
,
server
->
port
,
(
SOCKADDR
*
)
&
server
->
addr
,
&
addr_len
,
server
->
addr_str
))
return
ERROR_INTERNET_NAME_NOT_RESOLVED
;
switch
(
server
->
addr
.
ss_family
)
{
case
AF_INET
:
addr
=
&
((
struct
sockaddr_in
*
)
&
server
->
addr
)
->
sin_addr
;
break
;
case
AF_INET6
:
addr
=
&
((
struct
sockaddr_in6
*
)
&
server
->
addr
)
->
sin6_addr
;
break
;
default:
WARN
(
"unsupported family %d
\n
"
,
server
->
addr
.
ss_family
);
return
ERROR_INTERNET_NAME_NOT_RESOLVED
;
}
server
->
addr_len
=
addr_len
;
inet_ntop
(
server
->
addr
.
ss_family
,
addr
,
server
->
addr_str
,
sizeof
(
server
->
addr_str
));
INTERNET_SendCallback
(
&
request
->
hdr
,
request
->
hdr
.
dwContext
,
INTERNET_STATUS_NAME_RESOLVED
,
server
->
addr_str
,
strlen
(
server
->
addr_str
)
+
1
);
...
...
dlls/wininet/internet.c
View file @
47778f95
...
...
@@ -3453,7 +3453,7 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe
socklen_t
sa_len
=
sizeof
(
saddr
);
int
fd
;
if
(
!
GetAddress
(
hostW
,
port
,
(
struct
sockaddr
*
)
&
saddr
,
&
sa_len
))
if
(
!
GetAddress
(
hostW
,
port
,
(
struct
sockaddr
*
)
&
saddr
,
&
sa_len
,
NULL
))
goto
End
;
init_winsock
();
fd
=
socket
(
saddr
.
ss_family
,
SOCK_STREAM
,
0
);
...
...
dlls/wininet/internet.h
View file @
47778f95
...
...
@@ -397,8 +397,7 @@ DWORD HTTP_Connect(appinfo_t*,LPCWSTR,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
DWORD
dwInternalFlags
,
HINTERNET
*
)
DECLSPEC_HIDDEN
;
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
struct
sockaddr
*
psa
,
socklen_t
*
sa_len
)
DECLSPEC_HIDDEN
;
BOOL
GetAddress
(
const
WCHAR
*
,
INTERNET_PORT
,
SOCKADDR
*
,
int
*
,
char
*
)
DECLSPEC_HIDDEN
;
DWORD
get_cookie_header
(
const
WCHAR
*
,
const
WCHAR
*
,
WCHAR
**
)
DECLSPEC_HIDDEN
;
DWORD
set_cookie
(
const
WCHAR
*
,
const
WCHAR
*
,
const
WCHAR
*
,
const
WCHAR
*
,
DWORD
)
DECLSPEC_HIDDEN
;
...
...
dlls/wininet/utility.c
View file @
47778f95
...
...
@@ -125,9 +125,10 @@ time_t ConvertTimeString(LPCWSTR asctime)
}
BOOL
GetAddress
(
const
WCHAR
*
name
,
INTERNET_PORT
port
,
struct
sockaddr
*
psa
,
socklen_t
*
sa_len
)
BOOL
GetAddress
(
const
WCHAR
*
name
,
INTERNET_PORT
port
,
struct
sockaddr
*
psa
,
int
*
sa_len
,
char
*
addr_str
)
{
ADDRINFOW
*
res
,
hints
;
void
*
addr
=
NULL
;
int
ret
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
name
));
...
...
@@ -162,13 +163,17 @@ BOOL GetAddress(const WCHAR *name, INTERNET_PORT port, struct sockaddr *psa, soc
switch
(
res
->
ai_family
)
{
case
AF_INET
:
addr
=
&
((
struct
sockaddr_in
*
)
psa
)
->
sin_addr
;
((
struct
sockaddr_in
*
)
psa
)
->
sin_port
=
htons
(
port
);
break
;
case
AF_INET6
:
addr
=
&
((
struct
sockaddr_in6
*
)
psa
)
->
sin6_addr
;
((
struct
sockaddr_in6
*
)
psa
)
->
sin6_port
=
htons
(
port
);
break
;
}
if
(
addr_str
)
inet_ntop
(
res
->
ai_family
,
addr
,
addr_str
,
INET6_ADDRSTRLEN
);
FreeAddrInfoW
(
res
);
return
TRUE
;
}
...
...
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