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
663c0146
Commit
663c0146
authored
Jul 15, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
Jul 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Fix behavior of InternetQueryDataAvailable if INTERNET_FLAG_ASYNC is set.
parent
fc48d6da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
11 deletions
+66
-11
internet.c
dlls/wininet/internet.c
+66
-11
No files found.
dlls/wininet/internet.c
View file @
663c0146
...
@@ -3251,10 +3251,40 @@ lend:
...
@@ -3251,10 +3251,40 @@ lend:
* Determines how much data is available to be read.
* Determines how much data is available to be read.
*
*
* RETURNS
* RETURNS
* If there is data available then TRUE, otherwise if there
* TRUE on success, FALSE if an error occurred. If
* is not or an error occurred then FALSE. Use GetLastError() to
* INTERNET_FLAG_ASYNC was specified in InternetOpen, and
* check for ERROR_NO_MORE_FILES to see if it was the former.
* no data is presently available, FALSE is returned with
* the last error ERROR_IO_PENDING; a callback with status
* INTERNET_STATUS_REQUEST_COMPLETE will be sent when more
* data is available.
*/
*/
void
AsyncInternetQueryDataAvailableProc
(
WORKREQUEST
*
workRequest
)
{
LPWININETHTTPREQW
lpwhr
;
INTERNET_ASYNC_RESULT
iar
;
char
buffer
[
4048
];
TRACE
(
"INTERNETQUERYDATAAVAILABLE %p
\n
"
,
workRequest
->
hdr
);
switch
(
workRequest
->
hdr
->
htype
)
{
case
WH_HHTTPREQ
:
lpwhr
=
(
LPWININETHTTPREQW
)
workRequest
->
hdr
;
iar
.
dwResult
=
NETCON_recv
(
&
lpwhr
->
netConnection
,
buffer
,
min
(
sizeof
(
buffer
),
lpwhr
->
dwContentLength
-
lpwhr
->
dwContentRead
),
MSG_PEEK
,
(
int
*
)
&
iar
.
dwError
);
INTERNET_SendCallback
(
workRequest
->
hdr
,
workRequest
->
hdr
->
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
break
;
default:
FIXME
(
"unsupported file type
\n
"
);
break
;
}
}
BOOL
WINAPI
InternetQueryDataAvailable
(
HINTERNET
hFile
,
BOOL
WINAPI
InternetQueryDataAvailable
(
HINTERNET
hFile
,
LPDWORD
lpdwNumberOfBytesAvailble
,
LPDWORD
lpdwNumberOfBytesAvailble
,
DWORD
dwFlags
,
DWORD
dwConext
)
DWORD
dwFlags
,
DWORD
dwConext
)
...
@@ -3278,20 +3308,45 @@ BOOL WINAPI InternetQueryDataAvailable( HINTERNET hFile,
...
@@ -3278,20 +3308,45 @@ BOOL WINAPI InternetQueryDataAvailable( HINTERNET hFile,
if
(
NETCON_query_data_available
(
&
lpwhr
->
netConnection
,
if
(
NETCON_query_data_available
(
&
lpwhr
->
netConnection
,
lpdwNumberOfBytesAvailble
))
lpdwNumberOfBytesAvailble
))
{
{
if
(
!*
lpdwNumberOfBytesAvailble
&&
retval
=
TRUE
;
!
NETCON_recv
(
&
lpwhr
->
netConnection
,
buffer
,
if
(
!*
lpdwNumberOfBytesAvailble
)
min
(
sizeof
(
buffer
),
lpwhr
->
dwContentLength
-
lpwhr
->
dwContentRead
),
MSG_PEEK
,
(
int
*
)
lpdwNumberOfBytesAvailble
))
{
{
INTERNET_SetLastError
(
ERROR_NO_MORE_FILES
);
/* Even if we are in async mode, we need to determine whether
retval
=
FALSE
;
* there is actually more data available. We do this by trying
* to peek only a single byte in async mode. */
BOOL
async
=
(
lpwhr
->
lpHttpSession
->
lpAppInfo
->
hdr
.
dwFlags
&
INTERNET_FLAG_ASYNC
);
if
(
!
NETCON_recv
(
&
lpwhr
->
netConnection
,
buffer
,
async
?
1
:
min
(
sizeof
(
buffer
),
lpwhr
->
dwContentLength
-
lpwhr
->
dwContentRead
),
MSG_PEEK
,
(
int
*
)
lpdwNumberOfBytesAvailble
))
{
INTERNET_SetLastError
(
ERROR_NO_MORE_FILES
);
retval
=
FALSE
;
}
else
if
(
async
&&
*
lpdwNumberOfBytesAvailble
)
{
WORKREQUEST
workRequest
;
*
lpdwNumberOfBytesAvailble
=
0
;
workRequest
.
asyncproc
=
AsyncInternetQueryDataAvailableProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwhr
->
hdr
);
retval
=
INTERNET_AsyncCall
(
&
workRequest
);
if
(
!
retval
)
{
WININET_Release
(
&
lpwhr
->
hdr
);
}
else
{
INTERNET_SetLastError
(
ERROR_IO_PENDING
);
retval
=
FALSE
;
}
}
}
}
retval
=
TRUE
;
}
}
else
else
{
{
INTERNET_SetLastError
(
ERROR_NO_MORE_FILES
);
INTERNET_SetLastError
(
ERROR_NO_MORE_FILES
);
retval
=
FALSE
;
}
}
break
;
break
;
...
...
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