From: rousskov <> Date: Wed, 1 Apr 1998 15:15:45 +0000 (+0000) Subject: - trying new algorithm to detect end-of-clean swap.state condition; this time X-Git-Tag: SQUID_3_0_PRE1~3658 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60603845bc028ef54faa22c7ee8c8e5ba9d9af12;p=thirdparty%2Fsquid.git - trying new algorithm to detect end-of-clean swap.state condition; this time we account for cc updates that may interleave new(dirty) entries with old (clean) ones. --- diff --git a/src/test_cache_digest.cc b/src/test_cache_digest.cc index efb0924e9d..ba8507be66 100644 --- a/src/test_cache_digest.cc +++ b/src/test_cache_digest.cc @@ -1,6 +1,6 @@ /* - * $Id: test_cache_digest.cc,v 1.12 1998/04/01 07:25:47 rousskov Exp $ + * $Id: test_cache_digest.cc,v 1.13 1998/04/01 08:15:45 rousskov Exp $ * * AUTHOR: Alex Rousskov * @@ -541,11 +541,15 @@ main(int argc, char *argv[]) for (i = 1; i < fi_count; ++i) { FileIterator *fi = fis[i]; while (fi->inner_time > 0) { - ready_time = fi->inner_time; - if (((storeSwapLogData*)fi->entry)->op == SWAP_LOG_DEL) - break; - assert(((storeSwapLogData*)fi->entry)->op == SWAP_LOG_ADD); - cacheStore(them, fi->entry, 0); + if (((storeSwapLogData*)fi->entry)->op == SWAP_LOG_DEL) { + cachePurge(them, fi->entry, 0); + if (ready_time < 0) + ready_time = fi->inner_time; + } else { + if (ready_time > 0 && fi->inner_time > ready_time) + break; + cacheStore(them, fi->entry, 0); + } fileIteratorAdvance(fi); } }