Http Fixes

Robert Shearman rob at codeweavers.com
Mon Sep 13 05:38:32 CDT 2004


Hi,

I have seen one server that likes to return "ICY" instead of "HTTP/1.x". 
This patch allows the connection to the server continue, as native does.

Rob

Changelog:
- Remove unused variable hIC.
- Remove check for HTTP signature in server reply.
- Fix stupid error with freeing the wrong buffer.
-------------- next part --------------
Index: wine/dlls/wininet/http.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/http.c,v
retrieving revision 1.79
diff -u -p -r1.79 http.c
--- wine/dlls/wininet/http.c	6 Sep 2004 20:27:04 -0000	1.79
+++ wine/dlls/wininet/http.c	13 Sep 2004 10:29:14 -0000
@@ -336,7 +336,6 @@ HINTERNET WINAPI HttpOpenRequestW(HINTER
 	DWORD dwFlags, DWORD dwContext)
 {
     LPWININETHTTPSESSIONW lpwhs;
-    LPWININETAPPINFOW hIC = NULL;
     HINTERNET handle = NULL;
 
     TRACE("(%p, %s, %s, %s, %s, %p, %08lx, %08lx)\n", hHttpSession,
@@ -356,7 +355,6 @@ HINTERNET WINAPI HttpOpenRequestW(HINTER
         INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
 	goto lend;
     }
-    hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
 
     /*
      * My tests seem to show that the windows version does not
@@ -1988,7 +1986,6 @@ BOOL HTTP_GetResponseHeaders(LPWININETHT
     BOOL bSuccess = FALSE;
     INT  rc = 0;
     WCHAR value[MAX_FIELD_VALUE_LEN], field[MAX_FIELD_LEN];
-    static const WCHAR szHttp[] = { 'H','T','T','P',0 };
     static const WCHAR szCrLf[] = {'\r','\n',0};
     char bufferA[MAX_REPLY_LEN];
     LPWSTR status_code, status_text;
@@ -2018,9 +2015,6 @@ BOOL HTTP_GetResponseHeaders(LPWININETHT
         goto lend;
     MultiByteToWideChar( CP_ACP, 0, bufferA, buflen, buffer, MAX_REPLY_LEN );
 
-    if (strncmpW(buffer, szHttp, 4) != 0)
-        goto lend;
-
     /* regenerate raw headers */
     while (cchRawHeaders + buflen + strlenW(szCrLf) > cchMaxRawHeaders)
     {
@@ -2084,7 +2078,7 @@ BOOL HTTP_GetResponseHeaders(LPWININETHT
 	}
     }while(1);
 
-    if (lpwhr->lpszRawHeaders) HeapFree(GetProcessHeap(), 0, lpszRawHeaders);
+    if (lpwhr->lpszRawHeaders) HeapFree(GetProcessHeap(), 0, lpwhr->lpszRawHeaders);
     lpwhr->lpszRawHeaders = lpszRawHeaders;
     TRACE("raw headers: %s\n", debugstr_w(lpszRawHeaders));
     bSuccess = TRUE;


More information about the wine-patches mailing list