wininet: Account for disk space usage when deleting url cache entries.
This commit is contained in:
parent
7c15dc50a2
commit
a039754103
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue