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
917df923
Commit
917df923
authored
May 13, 2004
by
Kevin Koltzau
Committed by
Alexandre Julliard
May 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent memory leak and superfluous status notifications.
parent
adc86dcc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
12 deletions
+45
-12
ftp.c
dlls/wininet/ftp.c
+14
-2
http.c
dlls/wininet/http.c
+18
-2
internet.c
dlls/wininet/internet.c
+6
-6
internet.h
dlls/wininet/internet.h
+7
-2
No files found.
dlls/wininet/ftp.c
View file @
917df923
...
...
@@ -1486,7 +1486,8 @@ lend:
HINTERNET
FTP_Connect
(
HINTERNET
hInternet
,
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
)
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
,
DWORD
dwInternalFlags
)
{
struct
sockaddr_in
socketAddr
;
struct
hostent
*
phe
=
NULL
;
...
...
@@ -1567,6 +1568,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCWSTR lpszServerName,
lpwfs
->
hdr
.
htype
=
WH_HFTPSESSION
;
lpwfs
->
hdr
.
dwFlags
=
dwFlags
;
lpwfs
->
hdr
.
dwContext
=
dwContext
;
lpwfs
->
hdr
.
dwInternalFlags
=
dwInternalFlags
;
lpwfs
->
hdr
.
lpwhparent
=
(
LPWININETHANDLEHEADER
)
hInternet
;
lpwfs
->
sndSocket
=
nsocket
;
lpwfs
->
download_in_progress
=
NULL
;
...
...
@@ -1587,7 +1589,8 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCWSTR lpszServerName,
if
(
FTP_ConnectToHost
(
lpwfs
))
{
if
(
hIC
->
lpfnStatusCB
)
/* Don't send a handle created callback if this handle was created with InternetOpenUrl */
if
(
hIC
->
lpfnStatusCB
&&
!
(
lpwfs
->
hdr
.
dwInternalFlags
&
INET_OPENURL
))
{
INTERNET_ASYNC_RESULT
iar
;
...
...
@@ -2499,6 +2502,7 @@ BOOL FTP_CloseFileTransferHandle(LPWININETFILE lpwh)
{
LPWININETFTPSESSIONA
lpwfs
=
(
LPWININETFTPSESSIONA
)
lpwh
->
hdr
.
lpwhparent
;
INT
nResCode
;
HINTERNET
handle
;
TRACE
(
"
\n
"
);
...
...
@@ -2518,6 +2522,14 @@ BOOL FTP_CloseFileTransferHandle(LPWININETFILE lpwh)
HeapFree
(
GetProcessHeap
(),
0
,
lpwh
);
/* If this handle was opened with InternetOpenUrl, we need to close the parent to prevent
a memory leek
*/
if
(
lpwfs
->
hdr
.
dwInternalFlags
&
INET_OPENURL
)
{
handle
=
WININET_FindHandle
(
&
lpwfs
->
hdr
);
InternetCloseHandle
(
handle
);
}
return
TRUE
;
}
...
...
dlls/wininet/http.c
View file @
917df923
...
...
@@ -1789,7 +1789,8 @@ lend:
*/
HINTERNET
HTTP_Connect
(
HINTERNET
hInternet
,
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
)
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
,
DWORD
dwInternalFlags
)
{
BOOL
bSuccess
=
FALSE
;
LPWININETAPPINFOW
hIC
=
NULL
;
...
...
@@ -1830,6 +1831,7 @@ HINTERNET HTTP_Connect(HINTERNET hInternet, LPCWSTR lpszServerName,
lpwhs
->
hdr
.
lpwhparent
=
&
hIC
->
hdr
;
lpwhs
->
hdr
.
dwFlags
=
dwFlags
;
lpwhs
->
hdr
.
dwContext
=
dwContext
;
lpwhs
->
hdr
.
dwInternalFlags
=
dwInternalFlags
;
if
(
hIC
->
lpszProxy
&&
hIC
->
dwAccessType
==
INTERNET_OPEN_TYPE_PROXY
)
{
if
(
strchrW
(
hIC
->
lpszProxy
,
' '
))
FIXME
(
"Several proxies not implemented.
\n
"
);
...
...
@@ -1842,7 +1844,8 @@ HINTERNET HTTP_Connect(HINTERNET hInternet, LPCWSTR lpszServerName,
lpwhs
->
lpszUserName
=
WININET_strdupW
(
lpszUserName
);
lpwhs
->
nServerPort
=
nServerPort
;
if
(
hIC
->
lpfnStatusCB
)
/* Don't send a handle created callback if this handle was created with InternetOpenUrl */
if
(
hIC
->
lpfnStatusCB
&&
!
(
lpwhs
->
hdr
.
dwInternalFlags
&
INET_OPENURL
))
{
INTERNET_ASYNC_RESULT
iar
;
...
...
@@ -2408,6 +2411,15 @@ void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQW lpwhr)
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
pCustHeaders
);
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
);
/* If this handle was opened with InternetOpenUrl, we need to close the parent to prevent
a memory leek
*/
if
(
lpwhs
->
hdr
.
dwInternalFlags
&
INET_OPENURL
)
{
handle
=
WININET_FindHandle
(
&
lpwhs
->
hdr
);
InternetCloseHandle
(
handle
);
}
}
...
...
@@ -2426,10 +2438,14 @@ void HTTP_CloseHTTPSessionHandle(LPWININETHTTPSESSIONW lpwhs)
hIC
=
(
LPWININETAPPINFOW
)
lpwhs
->
hdr
.
lpwhparent
;
/* Don't send a handle closing callback if this handle was created with InternetOpenUrl */
if
(
!
(
lpwhs
->
hdr
.
dwInternalFlags
&
INET_OPENURL
))
{
handle
=
WININET_FindHandle
(
&
lpwhs
->
hdr
);
SendAsyncCallback
(
hIC
,
handle
,
lpwhs
->
hdr
.
dwContext
,
INTERNET_STATUS_HANDLE_CLOSING
,
lpwhs
,
sizeof
(
HINTERNET
));
}
if
(
lpwhs
->
lpszServerName
)
HeapFree
(
GetProcessHeap
(),
0
,
lpwhs
->
lpszServerName
);
...
...
dlls/wininet/internet.c
View file @
917df923
...
...
@@ -665,12 +665,12 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
{
case
INTERNET_SERVICE_FTP
:
rc
=
FTP_Connect
(
hInternet
,
lpszServerName
,
nServerPort
,
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
);
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
,
0
);
break
;
case
INTERNET_SERVICE_HTTP
:
rc
=
HTTP_Connect
(
hInternet
,
lpszServerName
,
nServerPort
,
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
);
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
,
0
);
break
;
case
INTERNET_SERVICE_GOPHER
:
...
...
@@ -2069,8 +2069,8 @@ HINTERNET WINAPI INTERNET_InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl,
case
INTERNET_SCHEME_FTP
:
if
(
urlComponents
.
nPort
==
0
)
urlComponents
.
nPort
=
INTERNET_DEFAULT_FTP_PORT
;
client
=
InternetConnectW
(
hInternet
,
hostName
,
urlComponents
.
nPort
,
userName
,
password
,
INTERNET_SERVICE_FTP
,
dwFlags
,
dwContext
);
client
=
FTP_Connect
(
hInternet
,
hostName
,
urlComponents
.
nPort
,
userName
,
password
,
dwFlags
,
dwContext
,
INET_OPENURL
);
client1
=
FtpOpenFileW
(
client
,
path
,
GENERIC_READ
,
dwFlags
,
dwContext
);
break
;
...
...
@@ -2084,8 +2084,8 @@ HINTERNET WINAPI INTERNET_InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl,
else
urlComponents
.
nPort
=
INTERNET_DEFAULT_HTTPS_PORT
;
}
client
=
InternetConnectW
(
hInternet
,
hostName
,
urlComponents
.
nPort
,
userName
,
password
,
INTERNET_SERVICE_HTTP
,
dwFlags
,
dwContext
);
client
=
HTTP_Connect
(
hInternet
,
hostName
,
urlComponents
.
nPort
,
userName
,
password
,
dwFlags
,
dwContext
,
INET_OPENURL
);
if
(
client
==
NULL
)
break
;
client1
=
HttpOpenRequestW
(
client
,
NULL
,
path
,
NULL
,
NULL
,
accept
,
dwFlags
,
dwContext
);
...
...
dlls/wininet/internet.h
View file @
917df923
...
...
@@ -81,12 +81,15 @@ typedef enum
WH_HHTTPREQ
=
INTERNET_HANDLE_TYPE_HTTP_REQUEST
,
}
WH_TYPE
;
#define INET_OPENURL 0x0001
typedef
struct
_WININETHANDLEHEADER
{
WH_TYPE
htype
;
DWORD
dwFlags
;
DWORD
dwContext
;
DWORD
dwError
;
DWORD
dwInternalFlags
;
struct
_WININETHANDLEHEADER
*
lpwhparent
;
}
WININETHANDLEHEADER
,
*
LPWININETHANDLEHEADER
;
...
...
@@ -346,11 +349,13 @@ time_t ConvertTimeString(LPCWSTR asctime);
HINTERNET
FTP_Connect
(
HINTERNET
hInterent
,
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
);
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
,
DWORD
dwInternalFlags
);
HINTERNET
HTTP_Connect
(
HINTERNET
hInterent
,
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
);
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
,
DWORD
dwInternalFlags
);
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
struct
hostent
**
phe
,
struct
sockaddr_in
*
psa
);
...
...
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