]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- trying new algorithm to detect end-of-clean swap.state condition; this time
authorrousskov <>
Wed, 1 Apr 1998 15:15:45 +0000 (15:15 +0000)
committerrousskov <>
Wed, 1 Apr 1998 15:15:45 +0000 (15:15 +0000)
  we account for cc updates that may interleave new(dirty) entries with old
  (clean) ones.

src/test_cache_digest.cc

index efb0924e9ddbc918f489322cbfc1ecb3e3b95697..ba8507be665aeae99b19806fea2ca603d7daebf3 100644 (file)
@@ -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);
        }
     }