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
e6157dde
Commit
e6157dde
authored
Nov 15, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Nov 15, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
We shouldn't pass the struct hostent returned from gethostbyname as
it's not thread-safe and isn't needed anyway.
parent
a63acd71
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
14 deletions
+11
-14
ftp.c
dlls/wininet/ftp.c
+1
-3
http.c
dlls/wininet/http.c
+3
-3
internet.h
dlls/wininet/internet.h
+1
-3
utility.c
dlls/wininet/utility.c
+6
-5
No files found.
dlls/wininet/ftp.c
View file @
e6157dde
...
...
@@ -1656,7 +1656,6 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
static
const
WCHAR
szDefaultUsername
[]
=
{
'a'
,
'n'
,
'o'
,
'n'
,
'y'
,
'm'
,
'o'
,
'u'
,
's'
,
'\0'
};
static
const
WCHAR
szDefaultPassword
[]
=
{
'u'
,
's'
,
'e'
,
'r'
,
'@'
,
's'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
'\0'
};
struct
sockaddr_in
socketAddr
;
struct
hostent
*
phe
=
NULL
;
INT
nsocket
=
-
1
;
UINT
sock_namelen
;
BOOL
bSuccess
=
FALSE
;
...
...
@@ -1734,7 +1733,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
SendAsyncCallback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_RESOLVING_NAME
,
(
LPWSTR
)
lpszServerName
,
strlenW
(
lpszServerName
));
if
(
!
GetAddress
(
lpszServerName
,
nServerPort
,
&
phe
,
&
socketAddr
))
if
(
!
GetAddress
(
lpszServerName
,
nServerPort
,
&
socketAddr
))
{
INTERNET_SetLastError
(
ERROR_INTERNET_NAME_NOT_RESOLVED
);
goto
lerror
;
...
...
@@ -1767,7 +1766,6 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
sock_namelen
=
sizeof
(
lpwfs
->
socketAddress
);
getsockname
(
nsocket
,
(
struct
sockaddr
*
)
&
lpwfs
->
socketAddress
,
&
sock_namelen
);
lpwfs
->
phostent
=
phe
;
if
(
FTP_ConnectToHost
(
lpwfs
))
{
...
...
dlls/wininet/http.c
View file @
e6157dde
...
...
@@ -813,7 +813,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
strlenW
(
lpwhs
->
lpszServerName
)
+
1
);
if
(
!
GetAddress
(
lpwhs
->
lpszServerName
,
lpwhs
->
nServerPort
,
&
lpwhs
->
phostent
,
&
lpwhs
->
socketAddress
))
&
lpwhs
->
socketAddress
))
{
INTERNET_SetLastError
(
ERROR_INTERNET_NAME_NOT_RESOLVED
);
InternetCloseHandle
(
handle
);
...
...
@@ -1397,7 +1397,7 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl, LPCWST
strlenW
(
lpwhs
->
lpszServerName
)
+
1
);
if
(
!
GetAddress
(
lpwhs
->
lpszServerName
,
lpwhs
->
nServerPort
,
&
lpwhs
->
phostent
,
&
lpwhs
->
socketAddress
))
&
lpwhs
->
socketAddress
))
{
INTERNET_SetLastError
(
ERROR_INTERNET_NAME_NOT_RESOLVED
);
return
FALSE
;
...
...
@@ -1917,7 +1917,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
&
(
lpwhs
->
socketAddress
),
sizeof
(
struct
sockaddr_in
));
if
(
!
NETCON_create
(
&
lpwhr
->
netConnection
,
lpwhs
->
phostent
->
h_addrtype
,
if
(
!
NETCON_create
(
&
lpwhr
->
netConnection
,
lpwhs
->
socketAddress
.
sin_family
,
SOCK_STREAM
,
0
))
{
WARN
(
"Socket creation failed
\n
"
);
...
...
dlls/wininet/internet.h
View file @
e6157dde
...
...
@@ -168,7 +168,6 @@ typedef struct
LPWSTR
lpszUserName
;
INTERNET_PORT
nServerPort
;
struct
sockaddr_in
socketAddress
;
struct
hostent
*
phostent
;
}
WININETHTTPSESSIONW
,
*
LPWININETHTTPSESSIONW
;
#define HDR_ISREQUEST 0x0001
...
...
@@ -214,7 +213,6 @@ typedef struct
LPWININETFILE
download_in_progress
;
struct
sockaddr_in
socketAddress
;
struct
sockaddr_in
lstnSocketAddress
;
struct
hostent
*
phostent
;
LPWSTR
lpszPassword
;
LPWSTR
lpszUserName
;
}
WININETFTPSESSIONW
,
*
LPWININETFTPSESSIONW
;
...
...
@@ -420,7 +418,7 @@ HINTERNET HTTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
DWORD
dwInternalFlags
);
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
struct
hostent
**
phe
,
struct
sockaddr_in
*
psa
);
struct
sockaddr_in
*
psa
);
void
INTERNET_SetLastError
(
DWORD
dwError
);
DWORD
INTERNET_GetLastError
(
void
);
...
...
dlls/wininet/utility.c
View file @
e6157dde
...
...
@@ -127,11 +127,12 @@ time_t ConvertTimeString(LPCWSTR asctime)
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
struct
hostent
**
phe
,
struct
sockaddr_in
*
psa
)
struct
sockaddr_in
*
psa
)
{
WCHAR
*
found
;
char
*
name
;
int
len
,
sz
;
struct
hostent
*
phe
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
lpszServerName
));
...
...
@@ -150,18 +151,18 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
+
1
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
lpszServerName
,
len
,
name
,
sz
,
NULL
,
NULL
);
name
[
sz
]
=
0
;
*
phe
=
gethostbyname
(
name
);
phe
=
gethostbyname
(
name
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
if
(
NULL
==
*
phe
)
if
(
NULL
==
phe
)
{
TRACE
(
"Failed to get hostname: (%s)
\n
"
,
debugstr_w
(
lpszServerName
)
);
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
;
memcpy
((
char
*
)
&
psa
->
sin_addr
,
phe
->
h_addr
,
phe
->
h_length
);
psa
->
sin_family
=
phe
->
h_addrtype
;
psa
->
sin_port
=
htons
((
u_short
)
nServerPort
);
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