From 7707a765b798bc39a3e2065530162decd5dbd647 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Thu, 10 Mar 2005 11:14:24 +0000 Subject: [PATCH] - Fully delete custom headers on connection opening. - Free unneeded memory on clearing of standard headers. - Fix index sanity test in delete function. --- dlls/wininet/http.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 5b94fee594f..e4c0a0cab0c 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -1977,6 +1977,8 @@ static void HTTP_clear_response_headers( LPWININETHTTPREQW lpwhr ) if ( lpwhr->StdHeaders[i].wFlags & HDR_ISREQUEST ) continue; HTTP_ReplaceHeaderValue( &lpwhr->StdHeaders[i], NULL ); + HeapFree( GetProcessHeap(), 0, lpwhr->StdHeaders[i].lpszField ); + lpwhr->StdHeaders[i].lpszField = NULL; } for( i=0; inCustHeaders; i++) { @@ -1986,7 +1988,8 @@ static void HTTP_clear_response_headers( LPWININETHTTPREQW lpwhr ) continue; if ( lpwhr->pCustHeaders[i].wFlags & HDR_ISREQUEST ) continue; - HTTP_ReplaceHeaderValue( &lpwhr->pCustHeaders[i], NULL ); + HTTP_DeleteCustomHeader( lpwhr, i ); + i--; } } @@ -2163,6 +2166,8 @@ LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer) if (!pszColon) { HTTP_FreeTokens(pTokenPair); + if (buffer[0]) + TRACE("No ':' in line: %s\n", debugstr_w(buffer)); return NULL; } @@ -2615,7 +2620,7 @@ BOOL HTTP_DeleteCustomHeader(LPWININETHTTPREQW lpwhr, DWORD index) { if( lpwhr->nCustHeaders <= 0 ) return FALSE; - if( lpwhr->nCustHeaders >= index ) + if( index >= lpwhr->nCustHeaders ) return FALSE; lpwhr->nCustHeaders--;