fix for rtm++ bug 54630 - Disk cache not writing files after 512 files reached. r=dp, sr=rpotts

This commit is contained in:
neeti%netscape.com 2000-10-13 03:01:10 +00:00
parent 3d941fde1e
commit 70a7f66f5c

View File

@ -595,9 +595,14 @@ nsReplacementPolicy::DeleteAtleastOneEntry(nsINetDataCache *aCache,
if (NS_FAILED(rv))
return rv;
if (targetNumEntries >= numRecordEntries)
return NS_ERROR_FAILURE;
/* Figure out if we are our end condition is number of entries or records */
if (targetNumEntries >= numRecordEntries) {
if (targetNumEntries < mNumEntries) {
numRecordEntries = mNumEntries;
}
else
return NS_ERROR_FAILURE;
}
// It's not possible to rank cache entries by their profitability
// until all of them are known to the replacement policy.