mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
winhttp: Make sure to clear response headers from a previous request.
This commit is contained in:
parent
418d2ce523
commit
71874a38aa
1 changed files with 16 additions and 16 deletions
|
@ -1038,6 +1038,20 @@ static BOOL add_host_header( request_t *request, DWORD modifier )
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void clear_response_headers( request_t *request )
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < request->num_headers; i++)
|
||||
{
|
||||
if (!request->headers[i].field) continue;
|
||||
if (!request->headers[i].value) continue;
|
||||
if (request->headers[i].is_request) continue;
|
||||
delete_header( request, i );
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len, LPVOID optional,
|
||||
DWORD optional_len, DWORD total_len, DWORD_PTR context, BOOL async )
|
||||
{
|
||||
|
@ -1053,6 +1067,8 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len
|
|||
int bytes_sent;
|
||||
DWORD len, i, flags;
|
||||
|
||||
clear_response_headers( request );
|
||||
|
||||
flags = WINHTTP_ADDREQ_FLAG_ADD|WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA;
|
||||
for (i = 0; i < request->num_accept_types; i++)
|
||||
{
|
||||
|
@ -1457,20 +1473,6 @@ static BOOL handle_authorization( request_t *request, DWORD status )
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void clear_response_headers( request_t *request )
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < request->num_headers; i++)
|
||||
{
|
||||
if (!request->headers[i].field) continue;
|
||||
if (!request->headers[i].value) continue;
|
||||
if (request->headers[i].is_request) continue;
|
||||
delete_header( request, i );
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
#define MAX_REPLY_LEN 1460
|
||||
#define INITIAL_HEADER_BUFFER_LEN 512
|
||||
|
||||
|
@ -1897,7 +1899,6 @@ static BOOL receive_response( request_t *request, BOOL async )
|
|||
|
||||
if (!(ret = handle_redirect( request, status ))) break;
|
||||
|
||||
clear_response_headers( request );
|
||||
send_request( request, NULL, 0, NULL, 0, 0, 0, FALSE ); /* recurse synchronously */
|
||||
continue;
|
||||
}
|
||||
|
@ -1911,7 +1912,6 @@ static BOOL receive_response( request_t *request, BOOL async )
|
|||
ret = TRUE;
|
||||
break;
|
||||
}
|
||||
clear_response_headers( request );
|
||||
send_request( request, NULL, 0, NULL, 0, 0, 0, FALSE );
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue