Jacek Caban : wininet: Explicity delete Content-Length header for gzip encoded connection.

Alexandre Julliard julliard at winehq.org
Mon Aug 3 11:14:03 CDT 2009


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jul 31 21:07:42 2009 +0200

wininet: Explicity delete Content-Length header for gzip encoded connection.

---

 dlls/wininet/http.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 693a44f..117d302 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -218,7 +218,7 @@ static void wininet_zfree(voidpf opaque, voidpf address)
 static void init_gzip_stream(http_request_t *req)
 {
     gzip_stream_t *gzip_stream;
-    int zres;
+    int index, zres;
 
     gzip_stream = HeapAlloc(GetProcessHeap(), 0, sizeof(gzip_stream_t));
     gzip_stream->zstream.zalloc = wininet_zalloc;
@@ -240,6 +240,10 @@ static void init_gzip_stream(http_request_t *req)
     }
 
     req->gzip_stream = gzip_stream;
+
+    index = HTTP_GetCustomHeaderIndex(req, szContent_Length, 0, FALSE);
+    if(index != -1)
+        HTTP_DeleteCustomHeader(req, index);
 }
 
 #else
@@ -2635,17 +2639,6 @@ static BOOL HTTP_HttpQueryInfoW(http_request_t *lpwhr, DWORD dwInfoLevel,
         if (!lpBuffer) return FALSE;
         index = HTTP_GetCustomHeaderIndex(lpwhr, lpBuffer, requested_index, request_only);
         break;
-
-    case HTTP_QUERY_CONTENT_LENGTH:
-        if(lpwhr->gzip_stream) {
-            INTERNET_SetLastError(ERROR_HTTP_HEADER_NOT_FOUND);
-            return FALSE;
-        }
-
-        index = HTTP_GetCustomHeaderIndex(lpwhr, header_lookup[level],
-                                          requested_index,request_only);
-        break;
-
     case HTTP_QUERY_RAW_HEADERS_CRLF:
         {
             LPWSTR headers;




More information about the wine-cvs mailing list