- Fully delete custom headers on connection opening.

- Free unneeded memory on clearing of standard headers.
- Fix index sanity test in delete function.
This commit is contained in:
Robert Shearman 2005-03-10 11:14:24 +00:00 committed by Alexandre Julliard
parent 401d4cf42a
commit 7707a765b7
1 changed files with 7 additions and 2 deletions

View File

@ -1977,6 +1977,8 @@ static void HTTP_clear_response_headers( LPWININETHTTPREQW lpwhr )
if ( lpwhr->StdHeaders[i].wFlags & HDR_ISREQUEST ) if ( lpwhr->StdHeaders[i].wFlags & HDR_ISREQUEST )
continue; continue;
HTTP_ReplaceHeaderValue( &lpwhr->StdHeaders[i], NULL ); HTTP_ReplaceHeaderValue( &lpwhr->StdHeaders[i], NULL );
HeapFree( GetProcessHeap(), 0, lpwhr->StdHeaders[i].lpszField );
lpwhr->StdHeaders[i].lpszField = NULL;
} }
for( i=0; i<lpwhr->nCustHeaders; i++) for( i=0; i<lpwhr->nCustHeaders; i++)
{ {
@ -1986,7 +1988,8 @@ static void HTTP_clear_response_headers( LPWININETHTTPREQW lpwhr )
continue; continue;
if ( lpwhr->pCustHeaders[i].wFlags & HDR_ISREQUEST ) if ( lpwhr->pCustHeaders[i].wFlags & HDR_ISREQUEST )
continue; continue;
HTTP_ReplaceHeaderValue( &lpwhr->pCustHeaders[i], NULL ); HTTP_DeleteCustomHeader( lpwhr, i );
i--;
} }
} }
@ -2163,6 +2166,8 @@ LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer)
if (!pszColon) if (!pszColon)
{ {
HTTP_FreeTokens(pTokenPair); HTTP_FreeTokens(pTokenPair);
if (buffer[0])
TRACE("No ':' in line: %s\n", debugstr_w(buffer));
return NULL; return NULL;
} }
@ -2615,7 +2620,7 @@ BOOL HTTP_DeleteCustomHeader(LPWININETHTTPREQW lpwhr, DWORD index)
{ {
if( lpwhr->nCustHeaders <= 0 ) if( lpwhr->nCustHeaders <= 0 )
return FALSE; return FALSE;
if( lpwhr->nCustHeaders >= index ) if( index >= lpwhr->nCustHeaders )
return FALSE; return FALSE;
lpwhr->nCustHeaders--; lpwhr->nCustHeaders--;