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

winhttp: Don't drain content until authorization is handled successfully.

parent e10c4814
...@@ -2421,8 +2421,8 @@ static BOOL receive_response( request_t *request, BOOL async ) ...@@ -2421,8 +2421,8 @@ static BOOL receive_response( request_t *request, BOOL async )
{ {
if (request->hdr.disable_flags & WINHTTP_DISABLE_AUTHENTICATION) break; if (request->hdr.disable_flags & WINHTTP_DISABLE_AUTHENTICATION) break;
drain_content( request );
if (!handle_authorization( request, status )) break; if (!handle_authorization( request, status )) break;
drain_content( request );
/* recurse synchronously */ /* recurse synchronously */
if ((ret = send_request( request, NULL, 0, request->optional, request->optional_len, 0, 0, FALSE ))) continue; if ((ret = send_request( request, NULL, 0, request->optional, request->optional_len, 0, 0, FALSE ))) continue;
...@@ -3062,7 +3062,7 @@ static HRESULT WINAPI winhttp_request_SetCredentials( ...@@ -3062,7 +3062,7 @@ static HRESULT WINAPI winhttp_request_SetCredentials(
DWORD target, scheme = WINHTTP_AUTH_SCHEME_BASIC; /* FIXME: query supported schemes */ DWORD target, scheme = WINHTTP_AUTH_SCHEME_BASIC; /* FIXME: query supported schemes */
DWORD err = ERROR_SUCCESS; DWORD err = ERROR_SUCCESS;
TRACE("%p, %s, %p\n", request, debugstr_w(username), password); TRACE("%p, %s, %p, 0x%08x\n", request, debugstr_w(username), password, flags);
EnterCriticalSection( &request->cs ); EnterCriticalSection( &request->cs );
if (request->state < REQUEST_STATE_OPEN) if (request->state < REQUEST_STATE_OPEN)
......
...@@ -2317,9 +2317,7 @@ static void test_basic_authentication(int port) ...@@ -2317,9 +2317,7 @@ static void test_basic_authentication(int port)
ok(ret || broken(error == ERROR_WINHTTP_SHUTDOWN || error == ERROR_WINHTTP_TIMEOUT) /* XP */, "failed to read data %u\n", GetLastError()); ok(ret || broken(error == ERROR_WINHTTP_SHUTDOWN || error == ERROR_WINHTTP_TIMEOUT) /* XP */, "failed to read data %u\n", GetLastError());
if (ret) if (ret)
{ {
todo_wine
ok(size == 12, "expected 12, got %u\n", size); ok(size == 12, "expected 12, got %u\n", size);
todo_wine
ok(!memcmp(buffer, unauthorized, 12), "got %s\n", buffer); ok(!memcmp(buffer, unauthorized, 12), "got %s\n", buffer);
} }
...@@ -3651,7 +3649,6 @@ static void test_IWinHttpRequest(int port) ...@@ -3651,7 +3649,6 @@ static void test_IWinHttpRequest(int port)
hr = IWinHttpRequest_get_ResponseText( req, &response ); hr = IWinHttpRequest_get_ResponseText( req, &response );
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
todo_wine
ok( !memcmp( response, unauthW, sizeof(unauthW) ), "got %s\n", wine_dbgstr_w(response) ); ok( !memcmp( response, unauthW, sizeof(unauthW) ), "got %s\n", wine_dbgstr_w(response) );
SysFreeString( response ); SysFreeString( response );
......
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