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
c140a704
Commit
c140a704
authored
Mar 09, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Propagate WSAEWOULDBLOCK from read_http_stream.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f42a2cca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
http.c
dlls/wininet/http.c
+19
-12
No files found.
dlls/wininet/http.c
View file @
c140a704
...
...
@@ -2572,12 +2572,8 @@ static DWORD read_http_stream(http_request_t *req, BYTE *buf, DWORD size, DWORD
DWORD
res
;
res
=
req
->
data_stream
->
vtbl
->
read
(
req
->
data_stream
,
req
,
buf
,
size
,
read
,
blocking_mode
);
if
(
res
!=
ERROR_SUCCESS
)
{
if
(
res
!=
WSAEWOULDBLOCK
)
return
res
;
if
(
res
!=
ERROR_SUCCESS
)
*
read
=
0
;
return
ERROR_SUCCESS
;
}
assert
(
*
read
<=
size
);
if
(
req
->
hCacheFile
)
{
...
...
@@ -2590,7 +2586,7 @@ static DWORD read_http_stream(http_request_t *req, BYTE *buf, DWORD size, DWORD
FIXME
(
"WriteFile failed: %u
\n
"
,
GetLastError
());
}
if
(
!*
read
||
req
->
data_stream
->
vtbl
->
end_of_data
(
req
->
data_stream
,
req
))
if
(
(
res
==
ERROR_SUCCESS
&&
!*
read
)
||
req
->
data_stream
->
vtbl
->
end_of_data
(
req
->
data_stream
,
req
))
commit_cache_entry
(
req
);
}
...
...
@@ -2613,6 +2609,9 @@ static DWORD refill_read_buffer(http_request_t *req, blocking_mode_t blocking_mo
res
=
read_http_stream
(
req
,
req
->
read_buf
+
req
->
read_size
,
sizeof
(
req
->
read_buf
)
-
req
->
read_size
,
&
read
,
blocking_mode
);
if
(
res
!=
ERROR_SUCCESS
)
return
res
;
req
->
read_size
+=
read
;
TRACE
(
"read %u bytes, read_size %u
\n
"
,
read
,
req
->
read_size
);
...
...
@@ -3004,17 +3003,19 @@ static void HTTP_ReceiveRequestData(http_request_t *req, BOOL first_notif, DWORD
mode
=
first_notif
&&
req
->
read_size
?
BLOCKING_DISALLOW
:
BLOCKING_ALLOW
;
res
=
refill_read_buffer
(
req
,
mode
,
&
read
);
if
(
res
==
ERROR_SUCCESS
)
if
(
res
==
ERROR_SUCCESS
)
{
avail
=
get_avail_data
(
req
);
read
+=
req
->
read_size
;
}
LeaveCriticalSection
(
&
req
->
read_section
);
if
(
res
!=
ERROR_SUCCESS
||
(
mode
!=
BLOCKING_DISALLOW
&&
!
read
))
{
if
(
res
!=
WSAEWOULDBLOCK
&&
(
res
!=
ERROR_SUCCESS
||
!
read
))
{
WARN
(
"res %u read %u, closing connection
\n
"
,
res
,
read
);
http_release_netconn
(
req
,
FALSE
);
}
if
(
res
!=
ERROR_SUCCESS
)
{
if
(
res
!=
ERROR_SUCCESS
&&
res
!=
WSAEWOULDBLOCK
)
{
send_request_complete
(
req
,
0
,
res
);
return
;
}
...
...
@@ -3046,7 +3047,10 @@ static DWORD HTTPREQ_Read(http_request_t *req, void *buffer, DWORD size, DWORD *
if
(
ret_read
<
size
)
{
res
=
read_http_stream
(
req
,
(
BYTE
*
)
buffer
+
ret_read
,
size
-
ret_read
,
&
current_read
,
blocking_mode
);
ret_read
+=
current_read
;
if
(
res
==
ERROR_SUCCESS
)
ret_read
+=
current_read
;
else
if
(
res
==
WSAEWOULDBLOCK
&&
ret_read
)
res
=
ERROR_SUCCESS
;
}
LeaveCriticalSection
(
&
req
->
read_section
);
...
...
@@ -3054,7 +3058,7 @@ static DWORD HTTPREQ_Read(http_request_t *req, void *buffer, DWORD size, DWORD *
*
read
=
ret_read
;
TRACE
(
"retrieved %u bytes (%u)
\n
"
,
ret_read
,
req
->
contentLength
);
if
(
size
&&
!
ret_read
)
if
(
res
!=
WSAEWOULDBLOCK
&&
(
!
ret_read
||
res
!=
ERROR_SUCCESS
)
)
http_release_netconn
(
req
,
res
==
ERROR_SUCCESS
);
return
res
;
...
...
@@ -3111,8 +3115,11 @@ static void AsyncReadFileExProc(task_header_t *hdr)
if
(
task
->
ret_read
)
res
=
HTTPREQ_Read
(
req
,
task
->
buf
,
task
->
size
,
&
read
,
BLOCKING_ALLOW
);
if
(
res
==
ERROR_SUCCESS
)
if
(
res
==
ERROR_SUCCESS
)
{
res
=
refill_read_buffer
(
req
,
task
->
ret_read
?
BLOCKING_DISALLOW
:
BLOCKING_ALLOW
,
&
buffered
);
if
(
res
==
WSAEWOULDBLOCK
)
res
=
ERROR_SUCCESS
;
}
if
(
res
==
ERROR_SUCCESS
)
{
if
(
task
->
ret_read
)
...
...
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