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

This commit is contained in:
Hans Leidekker 2012-01-27 10:53:50 +01:00 committed by Alexandre Julliard
parent 07ed66f8ec
commit ebc4fd1462
2 changed files with 6 additions and 1 deletions

View file

@ -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;

View file

@ -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};