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
86d14ad1
Commit
86d14ad1
authored
Jun 20, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Use INTERNET_SendCallback in ftp.c.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0d9dcf5c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
83 deletions
+22
-83
ftp.c
dlls/wininet/ftp.c
+22
-22
internet.h
dlls/wininet/internet.h
+0
-4
utility.c
dlls/wininet/utility.c
+0
-57
No files found.
dlls/wininet/ftp.c
View file @
86d14ad1
...
...
@@ -359,7 +359,7 @@ static BOOL FTP_FtpPutFileW(ftp_session_t *lpwfs, LPCWSTR lpszLocalFile,
hIC
=
lpwfs
->
lpAppInfo
;
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_SENDING_REQUEST
,
NULL
,
0
);
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_SENDING_REQUEST
,
NULL
,
0
);
if
(
FTP_SendStore
(
lpwfs
,
lpszNewRemoteFile
,
dwFlags
))
{
...
...
@@ -393,7 +393,7 @@ static BOOL FTP_FtpPutFileW(ftp_session_t *lpwfs, LPCWSTR lpszLocalFile,
iar
.
dwResult
=
(
DWORD
)
bSuccess
;
iar
.
dwError
=
bSuccess
?
ERROR_SUCCESS
:
INTERNET_GetLastError
();
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
...
...
@@ -543,7 +543,7 @@ lend:
iar
.
dwResult
=
bSuccess
;
iar
.
dwError
=
bSuccess
?
ERROR_SUCCESS
:
ERROR_INTERNET_EXTENDED_ERROR
;
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
return
bSuccess
;
...
...
@@ -686,7 +686,7 @@ lend:
iar
.
dwResult
=
(
DWORD
)
bSuccess
;
iar
.
dwError
=
bSuccess
?
ERROR_SUCCESS
:
INTERNET_GetLastError
();
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
...
...
@@ -886,13 +886,13 @@ lend:
{
iar
.
dwResult
=
(
DWORD_PTR
)
hFindNext
;
iar
.
dwError
=
ERROR_SUCCESS
;
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_HANDLE_CREATED
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_HANDLE_CREATED
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
iar
.
dwResult
=
(
DWORD_PTR
)
hFindNext
;
iar
.
dwError
=
hFindNext
?
ERROR_SUCCESS
:
INTERNET_GetLastError
();
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
...
...
@@ -1096,7 +1096,7 @@ lend:
iar
.
dwResult
=
bSuccess
;
iar
.
dwError
=
bSuccess
?
ERROR_SUCCESS
:
ERROR_INTERNET_EXTENDED_ERROR
;
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
...
...
@@ -1412,7 +1412,7 @@ static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
{
iar
.
dwResult
=
(
DWORD_PTR
)
lpwh
->
hdr
.
hInternet
;
iar
.
dwError
=
ERROR_SUCCESS
;
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_HANDLE_CREATED
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_HANDLE_CREATED
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
...
...
@@ -1421,7 +1421,7 @@ static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
}
else
{
iar
.
dwResult
=
0
;
iar
.
dwError
=
INTERNET_GetLastError
();
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
}
...
...
@@ -1746,7 +1746,7 @@ static BOOL FTP_FtpGetFileW(ftp_session_t *lpwfs, LPCWSTR lpszRemoteFile, LPCWST
iar
.
dwResult
=
(
DWORD
)
bSuccess
;
iar
.
dwError
=
bSuccess
?
ERROR_SUCCESS
:
INTERNET_GetLastError
();
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
...
...
@@ -1906,7 +1906,7 @@ lend:
iar
.
dwResult
=
(
DWORD
)
bSuccess
;
iar
.
dwError
=
bSuccess
?
ERROR_SUCCESS
:
INTERNET_GetLastError
();
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
...
...
@@ -2049,7 +2049,7 @@ lend:
iar
.
dwResult
=
(
DWORD
)
bSuccess
;
iar
.
dwError
=
bSuccess
?
ERROR_SUCCESS
:
INTERNET_GetLastError
();
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
...
...
@@ -2208,7 +2208,7 @@ lend:
iar
.
dwResult
=
(
DWORD
)
bSuccess
;
iar
.
dwError
=
bSuccess
?
ERROR_SUCCESS
:
INTERNET_GetLastError
();
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
...
...
@@ -2360,7 +2360,7 @@ static void FTPSESSION_CloseConnection(object_header_t *hdr)
TRACE
(
"
\n
"
);
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_CLOSING_CONNECTION
,
0
,
0
);
if
(
lpwfs
->
download_in_progress
!=
NULL
)
...
...
@@ -2375,7 +2375,7 @@ static void FTPSESSION_CloseConnection(object_header_t *hdr)
if
(
lpwfs
->
pasvSocket
!=
-
1
)
closesocket
(
lpwfs
->
pasvSocket
);
SendAsync
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
lpwfs
->
hdr
.
dwContext
,
INTERNET_STATUS_CONNECTION_CLOSED
,
0
,
0
);
}
...
...
@@ -2526,12 +2526,12 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
iar
.
dwResult
=
(
DWORD_PTR
)
lpwfs
->
hdr
.
hInternet
;
iar
.
dwError
=
ERROR_SUCCESS
;
SendAsync
Callback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_Send
Callback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_HANDLE_CREATED
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
SendAsync
Callback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_RESOLVING_NAME
,
INTERNET_Send
Callback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_RESOLVING_NAME
,
(
LPWSTR
)
lpszServerName
,
(
strlenW
(
lpszServerName
)
+
1
)
*
sizeof
(
WCHAR
));
sock_namelen
=
sizeof
(
socketAddr
);
...
...
@@ -2548,7 +2548,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
goto
lerror
;
}
SendAsync
Callback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_NAME_RESOLVED
,
INTERNET_Send
Callback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_NAME_RESOLVED
,
szaddr
,
strlen
(
szaddr
)
+
1
);
init_winsock
();
...
...
@@ -2559,7 +2559,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
goto
lerror
;
}
SendAsync
Callback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_CONNECTING_TO_SERVER
,
INTERNET_Send
Callback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_CONNECTING_TO_SERVER
,
szaddr
,
strlen
(
szaddr
)
+
1
);
if
(
connect
(
nsocket
,
(
struct
sockaddr
*
)
&
socketAddr
,
sock_namelen
)
<
0
)
...
...
@@ -2572,7 +2572,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
{
TRACE
(
"Connected to server
\n
"
);
lpwfs
->
sndSocket
=
nsocket
;
SendAsync
Callback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_CONNECTED_TO_SERVER
,
INTERNET_Send
Callback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_CONNECTED_TO_SERVER
,
szaddr
,
strlen
(
szaddr
)
+
1
);
sock_namelen
=
sizeof
(
lpwfs
->
socketAddress
);
...
...
@@ -2786,7 +2786,7 @@ INT FTP_ReceiveResponse(ftp_session_t *lpwfs, DWORD_PTR dwContext)
TRACE
(
"socket(%d)
\n
"
,
lpwfs
->
sndSocket
);
SendAsync
Callback
(
&
lpwfs
->
hdr
,
dwContext
,
INTERNET_STATUS_RECEIVING_RESPONSE
,
NULL
,
0
);
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
dwContext
,
INTERNET_STATUS_RECEIVING_RESPONSE
,
NULL
,
0
);
while
(
1
)
{
...
...
@@ -2819,7 +2819,7 @@ INT FTP_ReceiveResponse(ftp_session_t *lpwfs, DWORD_PTR dwContext)
{
rc
=
atoi
(
lpszResponse
);
SendAsync
Callback
(
&
lpwfs
->
hdr
,
dwContext
,
INTERNET_STATUS_RESPONSE_RECEIVED
,
INTERNET_Send
Callback
(
&
lpwfs
->
hdr
,
dwContext
,
INTERNET_STATUS_RESPONSE_RECEIVED
,
&
nRecv
,
sizeof
(
DWORD
));
}
...
...
dlls/wininet/internet.h
View file @
86d14ad1
...
...
@@ -443,10 +443,6 @@ DWORD INTERNET_GetLastError(void) DECLSPEC_HIDDEN;
DWORD
INTERNET_AsyncCall
(
task_header_t
*
)
DECLSPEC_HIDDEN
;
LPSTR
INTERNET_GetResponseBuffer
(
void
)
DECLSPEC_HIDDEN
;
VOID
SendAsyncCallback
(
object_header_t
*
hdr
,
DWORD_PTR
dwContext
,
DWORD
dwInternetStatus
,
LPVOID
lpvStatusInfo
,
DWORD
dwStatusInfoLength
)
DECLSPEC_HIDDEN
;
VOID
INTERNET_SendCallback
(
object_header_t
*
hdr
,
DWORD_PTR
dwContext
,
DWORD
dwInternetStatus
,
LPVOID
lpvStatusInfo
,
DWORD
dwStatusInfoLength
)
DECLSPEC_HIDDEN
;
...
...
dlls/wininet/utility.c
View file @
86d14ad1
...
...
@@ -275,60 +275,3 @@ void INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR context, DWORD status
if
(
new_info
!=
info
)
heap_free
(
new_info
);
}
typedef
struct
{
task_header_t
hdr
;
DWORD_PTR
context
;
DWORD
status
;
LPVOID
status_info
;
DWORD
status_info_len
;
}
send_callback_task_t
;
static
void
SendAsyncCallbackProc
(
task_header_t
*
hdr
)
{
send_callback_task_t
*
task
=
(
send_callback_task_t
*
)
hdr
;
TRACE
(
"%p
\n
"
,
task
->
hdr
.
hdr
);
INTERNET_SendCallback
(
task
->
hdr
.
hdr
,
task
->
context
,
task
->
status
,
task
->
status_info
,
task
->
status_info_len
);
/* And frees the copy of the status info */
heap_free
(
task
->
status_info
);
}
void
SendAsyncCallback
(
object_header_t
*
hdr
,
DWORD_PTR
dwContext
,
DWORD
dwInternetStatus
,
LPVOID
lpvStatusInfo
,
DWORD
dwStatusInfoLength
)
{
TRACE
(
"(%p, %08lx, %d (%s), %p, %d): %sasync call with callback %p
\n
"
,
hdr
,
dwContext
,
dwInternetStatus
,
get_callback_name
(
dwInternetStatus
),
lpvStatusInfo
,
dwStatusInfoLength
,
hdr
->
dwFlags
&
INTERNET_FLAG_ASYNC
?
""
:
"non "
,
hdr
->
lpfnStatusCB
);
if
(
!
(
hdr
->
lpfnStatusCB
))
return
;
if
(
hdr
->
dwFlags
&
INTERNET_FLAG_ASYNC
)
{
send_callback_task_t
*
task
;
void
*
lpvStatusInfo_copy
=
lpvStatusInfo
;
if
(
lpvStatusInfo
)
{
lpvStatusInfo_copy
=
heap_alloc
(
dwStatusInfoLength
);
memcpy
(
lpvStatusInfo_copy
,
lpvStatusInfo
,
dwStatusInfoLength
);
}
task
=
alloc_async_task
(
hdr
,
SendAsyncCallbackProc
,
sizeof
(
*
task
));
task
->
context
=
dwContext
;
task
->
status
=
dwInternetStatus
;
task
->
status_info
=
lpvStatusInfo_copy
;
task
->
status_info_len
=
dwStatusInfoLength
;
INTERNET_AsyncCall
(
&
task
->
hdr
);
}
else
INTERNET_SendCallback
(
hdr
,
dwContext
,
dwInternetStatus
,
lpvStatusInfo
,
dwStatusInfoLength
);
}
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