From: wessels <> Date: Sat, 7 Feb 1998 01:54:09 +0000 (+0000) Subject: store dirty rebuild fixes X-Git-Tag: SQUID_3_0_PRE1~4142 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c128028c6f78e102caae3feaecbcf107cdcd90e;p=thirdparty%2Fsquid.git store dirty rebuild fixes --- diff --git a/src/store.cc b/src/store.cc index 62ce8a6f28..2fa65114cb 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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 diff --git a/src/store_dir.cc b/src/store_dir.cc index db444f47c5..bdc883b41b 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -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; } diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index 8591919d01..a8744cf582 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -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++; }