From: rousskov <> Date: Mon, 30 Mar 1998 03:39:53 +0000 (+0000) Subject: - bug fixes X-Git-Tag: SQUID_3_0_PRE1~3706 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=681e79241d8fb86285a76ef55b4392d32ce29ec2;p=thirdparty%2Fsquid.git - bug fixes --- diff --git a/src/cache_diff.cc b/src/cache_diff.cc index 260c4fc58d..44cc42eb62 100644 --- a/src/cache_diff.cc +++ b/src/cache_diff.cc @@ -1,5 +1,5 @@ /* - * $Id: cache_diff.cc,v 1.3 1998/03/29 20:32:16 rousskov Exp $ + * $Id: cache_diff.cc,v 1.4 1998/03/29 20:39:53 rousskov Exp $ * * AUTHOR: Alex Rousskov * @@ -174,7 +174,10 @@ cacheIndexScan(CacheIndex *idx, const char *fname, FILE *file) if (!olde) idx->bad_del_count++; else { + assert(idx->count); hash_remove_link(idx->hash, (hash_link*) olde); + cacheEntryDestroy(olde); + idx->count--; } } else { fprintf(stderr, "%s:%d: unknown swap log action\n", fname, count); @@ -203,6 +206,7 @@ static void cacheIndexCmp(CacheIndex *idx1, CacheIndex *idx2) { int shared_count = 0; + int hashed_count = 0; hash_link *hashr = NULL; CacheIndex *small_idx = idx1; CacheIndex *large_idx = idx2; @@ -215,9 +219,11 @@ cacheIndexCmp(CacheIndex *idx1, CacheIndex *idx2) } /* find shared_count */ for (hashr = hash_first(small_idx->hash); hashr; hashr = hash_next(small_idx->hash)) { + hashed_count++; if (hash_lookup(large_idx->hash, hashr->key)) shared_count++; } + assert(hashed_count == small_idx->count); cacheIndexCmpReport(idx1, shared_count); cacheIndexCmpReport(idx2, shared_count);