From 31abbd708286571f85371ecb2a63fa636df7e537 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 7 Mar 2011 21:04:20 -0800 Subject: [PATCH] wininet: Don't adjust the use counts in RetrieveUrlCacheEntryFile until the function will succeed. --- dlls/wininet/urlcache.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c index 0c883726bae..8ab2ee6ede5 100644 --- a/dlls/wininet/urlcache.c +++ b/dlls/wininet/urlcache.c @@ -1996,11 +1996,6 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA( TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo); - pUrlEntry->dwHitRate++; - pUrlEntry->dwUseCount++; - GetSystemTimeAsFileTime(&pUrlEntry->LastAccessTime); - URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount); - error = URLCache_CopyEntry(pContainer, pHeader, lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize, pUrlEntry, FALSE); @@ -2012,6 +2007,11 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA( } TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName)); + pUrlEntry->dwHitRate++; + pUrlEntry->dwUseCount++; + URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount); + GetSystemTimeAsFileTime(&pUrlEntry->LastAccessTime); + URLCacheContainer_UnlockIndex(pContainer, pHeader); return TRUE; @@ -2093,11 +2093,6 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW( TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo); - pUrlEntry->dwHitRate++; - pUrlEntry->dwUseCount++; - GetSystemTimeAsFileTime(&pUrlEntry->LastAccessTime); - URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount); - error = URLCache_CopyEntry( pContainer, pHeader, @@ -2113,6 +2108,11 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW( } TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName)); + pUrlEntry->dwHitRate++; + pUrlEntry->dwUseCount++; + URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount); + GetSystemTimeAsFileTime(&pUrlEntry->LastAccessTime); + URLCacheContainer_UnlockIndex(pContainer, pHeader); return TRUE;