Hans Leidekker : wininet: Don' t destroy authentication data when closing the connection.
Alexandre Julliard
julliard at winehq.org
Fri Oct 17 07:26:15 CDT 2008
Module: wine
Branch: master
Commit: d5dca63cb6f820cfd39c2a153e6d48b815e950e0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d5dca63cb6f820cfd39c2a153e6d48b815e950e0
Author: Hans Leidekker <hans at codeweavers.com>
Date: Fri Oct 17 13:46:25 2008 +0200
wininet: Don't destroy authentication data when closing the connection.
Fixes basic authentication in combination with connection close semantics.
Spotted by Vincent Povirk.
---
dlls/wininet/http.c | 51 ++++++++++++++++++++++++++-------------------------
1 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 0cdbfb3..8729df3 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1380,31 +1380,6 @@ static void HTTPREQ_Destroy(WININETHANDLEHEADER *hdr)
WININET_Release(&lpwhr->lpHttpSession->hdr);
- HeapFree(GetProcessHeap(), 0, lpwhr->lpszPath);
- HeapFree(GetProcessHeap(), 0, lpwhr->lpszVerb);
- HeapFree(GetProcessHeap(), 0, lpwhr->lpszRawHeaders);
- HeapFree(GetProcessHeap(), 0, lpwhr->lpszVersion);
- HeapFree(GetProcessHeap(), 0, lpwhr->lpszStatusText);
-
- for (i = 0; i < lpwhr->nCustHeaders; i++)
- {
- HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders[i].lpszField);
- HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders[i].lpszValue);
- }
-
- HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders);
- HeapFree(GetProcessHeap(), 0, lpwhr);
-}
-
-static void HTTPREQ_CloseConnection(WININETHANDLEHEADER *hdr)
-{
- LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) hdr;
-
- TRACE("%p\n",lpwhr);
-
- if (!NETCON_connected(&lpwhr->netConnection))
- return;
-
if (lpwhr->pAuthInfo)
{
if (SecIsValidHandle(&lpwhr->pAuthInfo->ctx))
@@ -1417,6 +1392,7 @@ static void HTTPREQ_CloseConnection(WININETHANDLEHEADER *hdr)
HeapFree(GetProcessHeap(), 0, lpwhr->pAuthInfo);
lpwhr->pAuthInfo = NULL;
}
+
if (lpwhr->pProxyAuthInfo)
{
if (SecIsValidHandle(&lpwhr->pProxyAuthInfo->ctx))
@@ -1430,6 +1406,31 @@ static void HTTPREQ_CloseConnection(WININETHANDLEHEADER *hdr)
lpwhr->pProxyAuthInfo = NULL;
}
+ HeapFree(GetProcessHeap(), 0, lpwhr->lpszPath);
+ HeapFree(GetProcessHeap(), 0, lpwhr->lpszVerb);
+ HeapFree(GetProcessHeap(), 0, lpwhr->lpszRawHeaders);
+ HeapFree(GetProcessHeap(), 0, lpwhr->lpszVersion);
+ HeapFree(GetProcessHeap(), 0, lpwhr->lpszStatusText);
+
+ for (i = 0; i < lpwhr->nCustHeaders; i++)
+ {
+ HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders[i].lpszField);
+ HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders[i].lpszValue);
+ }
+
+ HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders);
+ HeapFree(GetProcessHeap(), 0, lpwhr);
+}
+
+static void HTTPREQ_CloseConnection(WININETHANDLEHEADER *hdr)
+{
+ LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) hdr;
+
+ TRACE("%p\n",lpwhr);
+
+ if (!NETCON_connected(&lpwhr->netConnection))
+ return;
+
INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
INTERNET_STATUS_CLOSING_CONNECTION, 0, 0);
More information about the wine-cvs
mailing list