wininet: Account for disk space usage when deleting url cache entries.

This commit is contained in:
Juan Lang 2011-03-08 08:06:10 -08:00 committed by Alexandre Julliard
parent 7c15dc50a2
commit a039754103
1 changed files with 8 additions and 0 deletions

View File

@ -2963,6 +2963,10 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
if (pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles) if (pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles)
pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles--; pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles--;
} }
if (pUrlEntry->size.QuadPart < pHeader->CacheUsage.QuadPart)
pHeader->CacheUsage.QuadPart -= pUrlEntry->size.QuadPart;
else
pHeader->CacheUsage.QuadPart = 0;
URLCache_DeleteEntry(pHeader, pEntry); URLCache_DeleteEntry(pHeader, pEntry);
@ -3042,6 +3046,10 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
if (pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles) if (pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles)
pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles--; pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles--;
} }
if (pUrlEntry->size.QuadPart < pHeader->CacheUsage.QuadPart)
pHeader->CacheUsage.QuadPart -= pUrlEntry->size.QuadPart;
else
pHeader->CacheUsage.QuadPart = 0;
URLCache_DeleteEntry(pHeader, pEntry); URLCache_DeleteEntry(pHeader, pEntry);