Hans Leidekker : winhttp: Call read_data() at least once in drain_content().

Alexandre Julliard julliard at winehq.org
Thu Sep 23 15:35:06 CDT 2021


Module: wine
Branch: master
Commit: 239964ce86ab3761c86862784c94461e5f9f516c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=239964ce86ab3761c86862784c94461e5f9f516c

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Sep 23 14:58:26 2021 +0200

winhttp: Call read_data() at least once in drain_content().

This ensures that response headers are processed even if there's no data to read.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50244
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winhttp/request.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index 8e390de549e..e229bdbfd31 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -1877,11 +1877,8 @@ static void drain_content( struct request *request )
     for (;;)
     {
         if (request->read_chunked) size = sizeof(buffer);
-        else
-        {
-            if (bytes_total >= bytes_left) return;
-            size = min( sizeof(buffer), bytes_left - bytes_total );
-        }
+        else size = min( sizeof(buffer), bytes_left - bytes_total );
+
         if (read_data( request, buffer, size, &bytes_read, FALSE ) || !bytes_read) return;
         bytes_total += bytes_read;
     }




More information about the wine-cvs mailing list