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
9c1bc32f
Commit
9c1bc32f
authored
Feb 20, 2024
by
Paul Gofman
Committed by
Alexandre Julliard
Feb 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Mind read size when skipping async read in WinHttpReadData().
parent
a3686eeb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
request.c
dlls/winhttp/request.c
+6
-4
No files found.
dlls/winhttp/request.c
View file @
9c1bc32f
...
...
@@ -3062,9 +3062,11 @@ static DWORD query_data_ready( struct request *request )
return
count
;
}
static
BOOL
skip_async_queue
(
struct
request
*
request
,
BOOL
*
wont_block
)
static
BOOL
skip_async_queue
(
struct
request
*
request
,
BOOL
*
wont_block
,
DWORD
to_read
)
{
*
wont_block
=
end_of_read_data
(
request
)
||
query_data_ready
(
request
);
if
(
!
request
->
read_chunked
)
to_read
=
min
(
to_read
,
request
->
content_length
-
request
->
content_read
);
*
wont_block
=
end_of_read_data
(
request
)
||
query_data_ready
(
request
)
>=
to_read
;
return
request
->
hdr
.
recursion_count
<
3
&&
*
wont_block
;
}
...
...
@@ -3133,7 +3135,7 @@ BOOL WINAPI WinHttpQueryDataAvailable( HINTERNET hrequest, LPDWORD available )
return
FALSE
;
}
if
(
!
(
async
=
request
->
connect
->
hdr
.
flags
&
WINHTTP_FLAG_ASYNC
)
||
skip_async_queue
(
request
,
&
wont_block
))
if
(
!
(
async
=
request
->
connect
->
hdr
.
flags
&
WINHTTP_FLAG_ASYNC
)
||
skip_async_queue
(
request
,
&
wont_block
,
1
))
{
ret
=
query_data_available
(
request
,
available
,
async
);
}
...
...
@@ -3229,7 +3231,7 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, void *buffer, DWORD to_read, DW
return
FALSE
;
}
if
(
!
(
async
=
request
->
connect
->
hdr
.
flags
&
WINHTTP_FLAG_ASYNC
)
||
skip_async_queue
(
request
,
&
wont_block
))
if
(
!
(
async
=
request
->
connect
->
hdr
.
flags
&
WINHTTP_FLAG_ASYNC
)
||
skip_async_queue
(
request
,
&
wont_block
,
to_read
))
{
ret
=
read_data
(
request
,
buffer
,
to_read
,
read
,
async
);
}
...
...
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