[3/3] winhttp: Don't attempt to read data after receiving a response to a HEAD request.

Hans Leidekker hans at codeweavers.com
Fri Jan 27 03:53:50 CST 2012


Fixes http://bugs.winehq.org/show_bug.cgi?id=29715
---
 dlls/winhttp/request.c         |    6 +++++-
 dlls/winhttp/winhttp_private.h |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index 516ff35..a3a92ab 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -2815,7 +2815,11 @@ static HRESULT request_receive( struct winhttp_request *request )
         return HRESULT_FROM_WIN32( get_last_error() );
     }
     if ((err = wait_for_completion( request ))) return HRESULT_FROM_WIN32( err );
-
+    if (!strcmpW( request->verb, headW ))
+    {
+        request->state = REQUEST_STATE_RESPONSE_RECEIVED;
+        return S_OK;
+    }
     if (!(request->buffer = heap_alloc( buflen ))) return E_OUTOFMEMORY;
     request->buffer[0] = 0;
     size = total_bytes_read = 0;
diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h
index 7105553..021bc93 100644
--- a/dlls/winhttp/winhttp_private.h
+++ b/dlls/winhttp/winhttp_private.h
@@ -46,6 +46,7 @@
 
 static const WCHAR getW[]    = {'G','E','T',0};
 static const WCHAR postW[]   = {'P','O','S','T',0};
+static const WCHAR headW[]   = {'H','E','A','D',0};
 static const WCHAR slashW[]  = {'/',0};
 static const WCHAR http1_0[] = {'H','T','T','P','/','1','.','0',0};
 static const WCHAR http1_1[] = {'H','T','T','P','/','1','.','1',0};
-- 
1.7.8.3






More information about the wine-patches mailing list