Commit ae05ce45 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp: Don't send any data if the verb is GET.

parent 2295c637
...@@ -2162,6 +2162,7 @@ struct winhttp_request ...@@ -2162,6 +2162,7 @@ struct winhttp_request
HINTERNET hsession; HINTERNET hsession;
HINTERNET hconnect; HINTERNET hconnect;
HINTERNET hrequest; HINTERNET hrequest;
WCHAR *verb;
HANDLE wait; HANDLE wait;
HANDLE cancel; HANDLE cancel;
char *buffer; char *buffer;
...@@ -2202,6 +2203,7 @@ static ULONG WINAPI winhttp_request_Release( ...@@ -2202,6 +2203,7 @@ static ULONG WINAPI winhttp_request_Release(
CloseHandle( request->wait ); CloseHandle( request->wait );
CloseHandle( request->cancel ); CloseHandle( request->cancel );
heap_free( request->buffer ); heap_free( request->buffer );
heap_free( request->verb );
heap_free( request ); heap_free( request );
} }
return refs; return refs;
...@@ -2444,6 +2446,7 @@ static HRESULT WINAPI winhttp_request_Open( ...@@ -2444,6 +2446,7 @@ static HRESULT WINAPI winhttp_request_Open(
debugstr_variant(&async)); debugstr_variant(&async));
if (!method || !url) return E_INVALIDARG; if (!method || !url) return E_INVALIDARG;
if (!(request->verb = strdupW( method ))) return E_OUTOFMEMORY;
memset( &uc, 0, sizeof(uc) ); memset( &uc, 0, sizeof(uc) );
uc.dwStructSize = sizeof(uc); uc.dwStructSize = sizeof(uc);
...@@ -2703,7 +2706,7 @@ static HRESULT WINAPI winhttp_request_Send( ...@@ -2703,7 +2706,7 @@ static HRESULT WINAPI winhttp_request_Send(
return HRESULT_FROM_WIN32( get_last_error() ); return HRESULT_FROM_WIN32( get_last_error() );
} }
VariantInit( &array ); VariantInit( &array );
if (VariantChangeType( &array, &body, 0, VT_ARRAY|VT_UI1 ) == S_OK) if (strcmpW( request->verb, getW ) && VariantChangeType( &array, &body, 0, VT_ARRAY|VT_UI1 ) == S_OK)
{ {
SAFEARRAY *sa = V_ARRAY( &array ); SAFEARRAY *sa = V_ARRAY( &array );
if ((hr = SafeArrayAccessData( sa, (void **)&ptr )) != S_OK) return hr; if ((hr = SafeArrayAccessData( sa, (void **)&ptr )) != S_OK) return hr;
...@@ -2986,6 +2989,7 @@ static HRESULT WINAPI winhttp_request_Abort( ...@@ -2986,6 +2989,7 @@ static HRESULT WINAPI winhttp_request_Abort(
CloseHandle( request->wait ); CloseHandle( request->wait );
CloseHandle( request->cancel ); CloseHandle( request->cancel );
heap_free( request->buffer ); heap_free( request->buffer );
heap_free( request->verb );
request->state = REQUEST_STATE_INVALID; request->state = REQUEST_STATE_INVALID;
request->hrequest = NULL; request->hrequest = NULL;
request->hconnect = NULL; request->hconnect = NULL;
...@@ -2993,6 +2997,7 @@ static HRESULT WINAPI winhttp_request_Abort( ...@@ -2993,6 +2997,7 @@ static HRESULT WINAPI winhttp_request_Abort(
request->wait = NULL; request->wait = NULL;
request->cancel = NULL; request->cancel = NULL;
request->buffer = NULL; request->buffer = NULL;
request->verb = NULL;
request->offset = 0; request->offset = 0;
request->bytes_available = 0; request->bytes_available = 0;
request->bytes_read = 0; request->bytes_read = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment