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
193da884
Commit
193da884
authored
May 23, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
May 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Correctly handle closed socket in HTTP_ReceiveRequestData.
parent
22f5e1f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
http.c
dlls/wininet/http.c
+17
-7
No files found.
dlls/wininet/http.c
View file @
193da884
...
...
@@ -2293,7 +2293,7 @@ static BOOL end_of_read_data( http_request_t *req )
}
/* fetch some more data into the read buffer (the read section must be held) */
static
DWORD
refill_read_buffer
(
http_request_t
*
req
,
read_mode_t
read_mode
)
static
DWORD
refill_read_buffer
(
http_request_t
*
req
,
read_mode_t
read_mode
,
DWORD
*
read_bytes
)
{
DWORD
res
,
read
=
0
;
...
...
@@ -2311,6 +2311,8 @@ static DWORD refill_read_buffer(http_request_t *req, read_mode_t read_mode)
req
->
read_size
+=
read
;
TRACE
(
"read %u bytes, read_size %u
\n
"
,
read
,
req
->
read_size
);
if
(
read_bytes
)
*
read_bytes
=
read
;
return
res
;
}
...
...
@@ -2636,22 +2638,30 @@ static DWORD set_content_length(http_request_t *request, DWORD status_code)
static
void
HTTP_ReceiveRequestData
(
http_request_t
*
req
,
BOOL
first_notif
)
{
INTERNET_ASYNC_RESULT
iar
;
DWORD
res
;
DWORD
res
,
read
=
0
;
read_mode_t
mode
;
TRACE
(
"%p
\n
"
,
req
);
EnterCriticalSection
(
&
req
->
read_section
);
if
((
res
=
refill_read_buffer
(
req
,
READMODE_ASYNC
))
==
ERROR_SUCCESS
)
{
mode
=
first_notif
&&
req
->
read_size
?
READMODE_NOBLOCK
:
READMODE_ASYNC
;
res
=
refill_read_buffer
(
req
,
mode
,
&
read
);
if
(
res
==
ERROR_SUCCESS
)
{
iar
.
dwResult
=
(
DWORD_PTR
)
req
->
hdr
.
hInternet
;
iar
.
dwError
=
first_notif
?
0
:
get_avail_data
(
req
);
if
(
!
first_notif
&&
!
iar
.
dwError
)
ERR
(
"No data reported!
\n
"
);
}
else
{
iar
.
dwResult
=
0
;
iar
.
dwError
=
res
;
}
LeaveCriticalSection
(
&
req
->
read_section
);
if
(
res
!=
ERROR_SUCCESS
||
(
mode
!=
READMODE_NOBLOCK
&&
!
read
))
{
WARN
(
"res %u read %u, closing connection
\n
"
,
res
,
read
);
http_release_netconn
(
req
,
FALSE
);
}
INTERNET_SendCallback
(
&
req
->
hdr
,
req
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
...
...
@@ -2970,7 +2980,7 @@ static DWORD HTTPREQ_QueryDataAvailable(object_header_t *hdr, DWORD *available,
/* never wait, if we can't enter the section we queue an async request right away */
if
(
TryEnterCriticalSection
(
&
req
->
read_section
))
{
refill_read_buffer
(
req
,
READMODE_NOBLOCK
);
refill_read_buffer
(
req
,
READMODE_NOBLOCK
,
NULL
);
if
((
*
available
=
get_avail_data
(
req
)))
goto
done
;
if
(
end_of_read_data
(
req
))
goto
done
;
LeaveCriticalSection
(
&
req
->
read_section
);
...
...
@@ -2988,7 +2998,7 @@ static DWORD HTTPREQ_QueryDataAvailable(object_header_t *hdr, DWORD *available,
if
(
!
(
*
available
=
get_avail_data
(
req
))
&&
!
end_of_read_data
(
req
))
{
refill_read_buffer
(
req
,
READMODE_ASYNC
);
refill_read_buffer
(
req
,
READMODE_ASYNC
,
NULL
);
*
available
=
get_avail_data
(
req
);
}
...
...
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