Module: wine Branch: master Commit: 5132fb4469a4914f6459486d69280b0745e11808 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5132fb4469a4914f6459486d69...
Author: Maarten Lankhorst m.b.lankhorst@gmail.com Date: Mon Feb 25 11:05:41 2008 -0800
wininet: Fix retrieving raw headers.
---
dlls/wininet/http.c | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 86154a5..478763e 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -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 {