Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8df906f2
Commit
8df906f2
authored
Sep 16, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Reset content length when all data has been read.
parent
11da0ac8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
request.c
dlls/winhttp/request.c
+14
-2
No files found.
dlls/winhttp/request.c
View file @
8df906f2
...
...
@@ -1226,6 +1226,13 @@ static BOOL receive_data_chunked( request_t *request, void *buffer, DWORD size,
return
TRUE
;
}
static
void
finished_reading
(
request_t
*
request
)
{
/* FIXME: close connection here if necessary */
request
->
content_length
=
~
0UL
;
request
->
content_read
=
0
;
}
static
BOOL
read_data
(
request_t
*
request
,
void
*
buffer
,
DWORD
to_read
,
DWORD
*
read
,
BOOL
async
)
{
static
const
WCHAR
chunked
[]
=
{
'c'
,
'h'
,
'u'
,
'n'
,
'k'
,
'e'
,
'd'
,
0
};
...
...
@@ -1253,7 +1260,11 @@ static BOOL read_data( request_t *request, void *buffer, DWORD to_read, DWORD *r
send_callback
(
&
request
->
hdr
,
WINHTTP_CALLBACK_STATUS_REQUEST_ERROR
,
&
result
,
sizeof
(
result
)
);
}
}
if
(
ret
&&
read
)
*
read
=
num_bytes
;
if
(
ret
)
{
if
(
read
)
*
read
=
num_bytes
;
if
(
!
num_bytes
)
finished_reading
(
request
);
}
return
ret
;
}
...
...
@@ -1263,6 +1274,7 @@ static void drain_content( request_t *request )
DWORD
bytes_read
;
char
buffer
[
2048
];
if
(
!
request
->
content_length
)
return
;
for
(;;)
{
if
(
!
read_data
(
request
,
buffer
,
sizeof
(
buffer
),
&
bytes_read
,
FALSE
)
||
!
bytes_read
)
return
;
...
...
@@ -1523,7 +1535,7 @@ static BOOL write_data( request_t *request, LPCVOID buffer, DWORD to_write, LPDW
if
(
async
)
{
if
(
ret
)
send_callback
(
&
request
->
hdr
,
WINHTTP_CALLBACK_
FLAG
_WRITE_COMPLETE
,
&
num_bytes
,
sizeof
(
DWORD
)
);
if
(
ret
)
send_callback
(
&
request
->
hdr
,
WINHTTP_CALLBACK_
STATUS
_WRITE_COMPLETE
,
&
num_bytes
,
sizeof
(
DWORD
)
);
else
{
WINHTTP_ASYNC_RESULT
result
;
...
...
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