From 70a7f66f5c7a1a973a2df63c389d8c06377464c8 Mon Sep 17 00:00:00 2001 From: "neeti%netscape.com" Date: Fri, 13 Oct 2000 03:01:10 +0000 Subject: [PATCH] fix for rtm++ bug 54630 - Disk cache not writing files after 512 files reached. r=dp, sr=rpotts --- netwerk/cache/mgr/nsReplacementPolicy.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/netwerk/cache/mgr/nsReplacementPolicy.cpp b/netwerk/cache/mgr/nsReplacementPolicy.cpp index 2c91ec7afc12..216401e2512b 100644 --- a/netwerk/cache/mgr/nsReplacementPolicy.cpp +++ b/netwerk/cache/mgr/nsReplacementPolicy.cpp @@ -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.