Eric van Beurden : wininet: Add a terminating empty line to the headers if necessary.

Alexandre Julliard julliard at winehq.org
Thu Jun 25 08:13:58 CDT 2009


Module: wine
Branch: master
Commit: 42c7dc94e2e45e9ed86e586dedb663d8e61b8275
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=42c7dc94e2e45e9ed86e586dedb663d8e61b8275

Author: Eric van Beurden <ericvb at transgaming.com>
Date:   Wed Jun 24 13:28:00 2009 -0400

wininet: Add a terminating empty line to the headers if necessary.

---

 dlls/wininet/http.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 3cdc8a6..f1a6ce7 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -4337,6 +4337,19 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear)
 	}
     }while(1);
 
+    /* make sure the response header is terminated with an empty line.  Some apps really
+       truly care about that empty line being there for some reason.  Just add it to the
+       header. */
+    if (cchRawHeaders + strlenW(szCrLf) > cchMaxRawHeaders)
+    {
+        cchMaxRawHeaders = cchRawHeaders + strlenW(szCrLf);
+        temp = HeapReAlloc(GetProcessHeap(), 0, lpszRawHeaders, (cchMaxRawHeaders + 1) * sizeof(WCHAR));
+        if (temp == NULL) goto lend;
+        lpszRawHeaders = temp;
+    }
+
+    memcpy(&lpszRawHeaders[cchRawHeaders], szCrLf, sizeof(szCrLf));
+
     HeapFree(GetProcessHeap(), 0, lpwhr->lpszRawHeaders);
     lpwhr->lpszRawHeaders = lpszRawHeaders;
     TRACE("raw headers: %s\n", debugstr_w(lpszRawHeaders));




More information about the wine-cvs mailing list