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
058761fa
Commit
058761fa
authored
Mar 26, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Support chunked reads in InternetReadFileEx too.
parent
fb2e9a3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
http.c
dlls/wininet/http.c
+13
-8
No files found.
dlls/wininet/http.c
View file @
058761fa
...
...
@@ -1564,7 +1564,7 @@ static DWORD HTTPREQ_SetOption(WININETHANDLEHEADER *hdr, DWORD option, void *buf
return
ERROR_INTERNET_INVALID_OPTION
;
}
static
DWORD
HTTP
REQ
_Read
(
WININETHTTPREQW
*
req
,
void
*
buffer
,
DWORD
size
,
DWORD
*
read
,
BOOL
sync
)
static
DWORD
HTTP_Read
(
WININETHTTPREQW
*
req
,
void
*
buffer
,
DWORD
size
,
DWORD
*
read
,
BOOL
sync
)
{
int
bytes_read
;
...
...
@@ -1611,7 +1611,7 @@ static DWORD get_chunk_size(const char *buffer)
return
size
;
}
static
DWORD
HTTP
REQ
_ReadChunked
(
WININETHTTPREQW
*
req
,
void
*
buffer
,
DWORD
size
,
DWORD
*
read
,
BOOL
sync
)
static
DWORD
HTTP_ReadChunked
(
WININETHTTPREQW
*
req
,
void
*
buffer
,
DWORD
size
,
DWORD
*
read
,
BOOL
sync
)
{
char
reply
[
MAX_REPLY_LEN
],
*
p
=
buffer
;
DWORD
buflen
,
to_write
=
size
;
...
...
@@ -1677,20 +1677,25 @@ static DWORD HTTPREQ_ReadChunked(WININETHTTPREQW *req, void *buffer, DWORD size,
return
ERROR_SUCCESS
;
}
static
DWORD
HTTPREQ_Read
File
(
WININETHANDLEHEADER
*
hdr
,
void
*
buffer
,
DWORD
size
,
DWORD
*
read
)
static
DWORD
HTTPREQ_Read
(
WININETHTTPREQW
*
req
,
void
*
buffer
,
DWORD
size
,
DWORD
*
read
,
BOOL
sync
)
{
WININETHTTPREQW
*
req
=
(
WININETHTTPREQW
*
)
hdr
;
static
WCHAR
encoding
[
20
];
WCHAR
encoding
[
20
];
DWORD
buflen
=
sizeof
(
encoding
);
static
const
WCHAR
szChunked
[]
=
{
'c'
,
'h'
,
'u'
,
'n'
,
'k'
,
'e'
,
'd'
,
0
};
if
(
HTTP_HttpQueryInfoW
(
req
,
HTTP_QUERY_TRANSFER_ENCODING
,
encoding
,
&
buflen
,
NULL
)
&&
!
strcmpiW
(
encoding
,
szChunked
))
{
return
HTTP
REQ_ReadChunked
(
req
,
buffer
,
size
,
read
,
TRUE
);
return
HTTP
_ReadChunked
(
req
,
buffer
,
size
,
read
,
sync
);
}
else
return
HTTPREQ_Read
(
req
,
buffer
,
size
,
read
,
TRUE
);
return
HTTP_Read
(
req
,
buffer
,
size
,
read
,
sync
);
}
static
DWORD
HTTPREQ_ReadFile
(
WININETHANDLEHEADER
*
hdr
,
void
*
buffer
,
DWORD
size
,
DWORD
*
read
)
{
WININETHTTPREQW
*
req
=
(
WININETHTTPREQW
*
)
hdr
;
return
HTTPREQ_Read
(
req
,
buffer
,
size
,
read
,
TRUE
);
}
static
void
HTTPREQ_AsyncReadFileExProc
(
WORKREQUEST
*
workRequest
)
...
...
@@ -2018,7 +2023,7 @@ static void HTTP_DrainContent(WININETHTTPREQW *req)
do
{
char
buffer
[
2048
];
if
(
HTTP
REQ
_Read
(
req
,
buffer
,
sizeof
(
buffer
),
&
bytes_read
,
TRUE
)
!=
ERROR_SUCCESS
)
if
(
HTTP_Read
(
req
,
buffer
,
sizeof
(
buffer
),
&
bytes_read
,
TRUE
)
!=
ERROR_SUCCESS
)
return
;
}
while
(
bytes_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