Daniel Lehman : wininet: Eat terminator on last chunk.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Mar 6 06:27:28 CST 2015
Module: wine
Branch: master
Commit: c921deebf1c97a07a2c8424306e559693f1d1cf3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c921deebf1c97a07a2c8424306e559693f1d1cf3
Author: Daniel Lehman <dlehman at esri.com>
Date: Thu Mar 5 12:45:26 2015 -0800
wininet: Eat terminator on last chunk.
---
dlls/wininet/http.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 328882e..04cd281 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -2763,8 +2763,19 @@ static DWORD start_next_chunk(chunked_stream_t *stream, http_request_t *req)
if (req->contentLength == ~0u) req->contentLength = chunk_size;
else req->contentLength += chunk_size;
- if (!chunk_size) stream->end_of_data = TRUE;
- return discard_chunked_eol(stream, req);
+ /* eat the rest of this line */
+ if ((res = discard_chunked_eol(stream, req)) != ERROR_SUCCESS)
+ return res;
+
+ /* if there's chunk data, return now */
+ if (chunk_size) return ERROR_SUCCESS;
+
+ /* otherwise, eat the terminator for this chunk */
+ if ((res = discard_chunked_eol(stream, req)) != ERROR_SUCCESS)
+ return res;
+
+ stream->end_of_data = TRUE;
+ return ERROR_SUCCESS;
}
remove_chunked_data(stream, 1);
}
More information about the wine-cvs
mailing list