Hans Leidekker : winhttp: Don' t try to read more data than available in the current chunk in refill_buffer.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 16 10:34:24 CDT 2015


Module: wine
Branch: master
Commit: e27a9bc6bc6f849e9dc2f2eda0d81a738d1d0fa5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e27a9bc6bc6f849e9dc2f2eda0d81a738d1d0fa5

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Mar 16 10:57:07 2015 +0100

winhttp: Don't try to read more data than available in the current chunk in refill_buffer.

---

 dlls/winhttp/request.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index 4efe2d8..d615011 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -2056,9 +2056,13 @@ static BOOL refill_buffer( request_t *request, BOOL notify )
         {
             if (!start_next_chunk( request, notify )) return FALSE;
         }
+        len = min( len, request->read_chunked_size );
     }
-    if (!request->read_chunked && request->content_length != ~0u)
+    else if (request->content_length != ~0u)
+    {
         len = min( len, request->content_length - request->content_read );
+    }
+
     if (len <= request->read_size) return TRUE;
     if (!read_more_data( request, len, notify )) return FALSE;
     if (!request->read_size) request->content_length = request->content_read = 0;




More information about the wine-cvs mailing list