Commit 31abbd70 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wininet: Don't adjust the use counts in RetrieveUrlCacheEntryFile until the function will succeed.

parent 51057e60
...@@ -1996,11 +1996,6 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA( ...@@ -1996,11 +1996,6 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl);
TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo); 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, error = URLCache_CopyEntry(pContainer, pHeader, lpCacheEntryInfo,
lpdwCacheEntryInfoBufferSize, pUrlEntry, lpdwCacheEntryInfoBufferSize, pUrlEntry,
FALSE); FALSE);
...@@ -2012,6 +2007,11 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA( ...@@ -2012,6 +2007,11 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
} }
TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName)); 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); URLCacheContainer_UnlockIndex(pContainer, pHeader);
return TRUE; return TRUE;
...@@ -2093,11 +2093,6 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW( ...@@ -2093,11 +2093,6 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW(
TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl);
TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo); TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo);
pUrlEntry->dwHitRate++;
pUrlEntry->dwUseCount++;
GetSystemTimeAsFileTime(&pUrlEntry->LastAccessTime);
URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount);
error = URLCache_CopyEntry( error = URLCache_CopyEntry(
pContainer, pContainer,
pHeader, pHeader,
...@@ -2113,6 +2108,11 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW( ...@@ -2113,6 +2108,11 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW(
} }
TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName)); 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); URLCacheContainer_UnlockIndex(pContainer, pHeader);
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment