]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
store dirty rebuild fixes
authorwessels <>
Sat, 7 Feb 1998 01:54:09 +0000 (01:54 +0000)
committerwessels <>
Sat, 7 Feb 1998 01:54:09 +0000 (01:54 +0000)
src/store.cc
src/store_dir.cc
src/store_rebuild.cc

index 62ce8a6f2870375959786735d3211d4cef0bbd9d..2fa65114cb6c182cfe3633a8d506b9cb527c797f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.377 1998/02/06 17:47:09 wessels Exp $
+ * $Id: store.cc,v 1.378 1998/02/06 18:54:09 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -230,7 +230,7 @@ destroy_StoreEntry(StoreEntry * e)
        destroy_MemObject(e);
     storeHashDelete(e);
     assert(e->key == NULL);
-    xfree(e);
+    memFree(MEM_STOREENTRY, e);
 }
 
 static void
index db444f47c51ad2000b3d8b87be1b80864228eb93..bdc883b41bd00390595aea94db9c925f170e3f96 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.47 1998/02/06 17:47:11 wessels Exp $
+ * $Id: store_dir.cc,v 1.48 1998/02/06 18:54:10 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -203,11 +203,13 @@ storeDirValidFileno(int fn)
 {
     int dirn = fn >> SWAP_DIR_SHIFT;
     int filn = fn & SWAP_FILE_MASK;
-    SwapDir *SD;
     if (dirn > Config.cacheSwap.n_configured)
        return 0;
-    SD = &Config.cacheSwap.swapDirs[dirn];
-    if (filn > SD->map->max_n_files)
+    if (dirn < 0)
+       return 0;
+    if (filn < 0)
+       return 0;
+    if (filn > Config.cacheSwap.swapDirs[dirn].map->max_n_files)
        return 0;
     return 1;
 }
index 8591919d01e51bc65fd5c82aea06eeb7390f6832..a8744cf582829fc43b755500d514e184d3cfac71 100644 (file)
@@ -216,8 +216,10 @@ storeRebuildFromSwapLog(rebuild_dir * d)
                storeExpireNow(e);
                storeSetPrivateKey(e);
                EBIT_SET(e->flag, RELEASE_REQUEST);
-               storeDirMapBitReset(e->swap_file_number);
-               e->swap_file_number = -1;
+               if (e->swap_file_number > -1) {
+                   storeDirMapBitReset(e->swap_file_number);
+                   e->swap_file_number = -1;
+               }
                RebuildState.objcount--;
                RebuildState.cancelcount++;
            }