Commit 92ddc1c8 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

wininet: Clean up HTTP_GetCustomHeaderIndex.

parent 7f5e2732
......@@ -2988,7 +2988,8 @@ static void HTTP_CloseHTTPSessionHandle(LPWININETHANDLEHEADER hdr)
* Return index of custom header from header array
*
*/
static INT HTTP_GetCustomHeaderIndex(LPWININETHTTPREQW lpwhr, LPCWSTR lpszField,int requested_index, BOOL request_only)
static INT HTTP_GetCustomHeaderIndex(LPWININETHTTPREQW lpwhr, LPCWSTR lpszField,
int requested_index, BOOL request_only)
{
DWORD index;
......@@ -2996,19 +2997,18 @@ static INT HTTP_GetCustomHeaderIndex(LPWININETHTTPREQW lpwhr, LPCWSTR lpszField,
for (index = 0; index < lpwhr->nCustHeaders; index++)
{
if (!strcmpiW(lpwhr->pCustHeaders[index].lpszField, lpszField))
{
if ((request_only &&
!(lpwhr->pCustHeaders[index].wFlags & HDR_ISREQUEST))||
(!request_only &&
(lpwhr->pCustHeaders[index].wFlags & HDR_ISREQUEST)))
if (strcmpiW(lpwhr->pCustHeaders[index].lpszField, lpszField))
continue;
if (request_only && !(lpwhr->pCustHeaders[index].wFlags & HDR_ISREQUEST))
continue;
if (!request_only && (lpwhr->pCustHeaders[index].wFlags & HDR_ISREQUEST))
continue;
if (requested_index == 0)
break;
else
requested_index --;
}
break;
requested_index --;
}
if (index >= lpwhr->nCustHeaders)
......
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