Module: wine Branch: master Commit: ebc4fd146285d4f45803d52b1b9da6cddfad2058 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ebc4fd146285d4f45803d52b1b...
Author: Hans Leidekker hans@codeweavers.com Date: Fri Jan 27 10:53:50 2012 +0100
winhttp: Don't attempt to read data after receiving a response to a HEAD request.
---
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};