wininet: Fix retrieving raw headers.

This commit is contained in:
Maarten Lankhorst 2008-02-25 11:05:41 -08:00 committed by Alexandre Julliard
parent 4e5c1bf6fd
commit 5132fb4469
1 changed files with 14 additions and 9 deletions

View File

@ -3080,6 +3080,20 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr)
} while (!strcmpW(status_code, szHundred)); /* ignore "100 Continue" responses */
/* Add status code */
HTTP_ProcessHeader(lpwhr, szStatus, status_code,
HTTP_ADDHDR_FLAG_REPLACE);
HeapFree(GetProcessHeap(),0,lpwhr->lpszVersion);
HeapFree(GetProcessHeap(),0,lpwhr->lpszStatusText);
lpwhr->lpszVersion= WININET_strdupW(buffer);
lpwhr->lpszStatusText = WININET_strdupW(status_text);
/* Restore the spaces */
*(status_code-1) = ' ';
*(status_text-1) = ' ';
/* regenerate raw headers */
while (cchRawHeaders + buflen + strlenW(szCrLf) > cchMaxRawHeaders)
{
@ -3092,15 +3106,6 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr)
cchRawHeaders += sizeof(szCrLf)/sizeof(szCrLf[0])-1;
lpszRawHeaders[cchRawHeaders] = '\0';
HTTP_ProcessHeader(lpwhr, szStatus, status_code,
HTTP_ADDHDR_FLAG_REPLACE);
HeapFree(GetProcessHeap(),0,lpwhr->lpszVersion);
HeapFree(GetProcessHeap(),0,lpwhr->lpszStatusText);
lpwhr->lpszVersion= WININET_strdupW(buffer);
lpwhr->lpszStatusText = WININET_strdupW(status_text);
/* Parse each response line */
do
{