From: wessels <> Date: Wed, 18 Jun 1997 22:15:53 +0000 (+0000) Subject: Put storeDeleteBehind() call before storeCopy callback. Apparently X-Git-Tag: SQUID_3_0_PRE1~4926 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38f903c46a6c6f804f16050f74a07ebed13afc7e;p=thirdparty%2Fsquid.git Put storeDeleteBehind() call before storeCopy callback. Apparently invoking the callback may release the StoreEntry, so either we need to lock it or do the delete behind first. --- diff --git a/src/store.cc b/src/store.cc index b185332b72..96cef5b3ad 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.258 1997/06/18 03:06:22 wessels Exp $ + * $Id: store.cc,v 1.259 1997/06/18 16:15:53 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -866,8 +866,7 @@ storeDeleteBehind(StoreEntry * e) int target_offset = storeGetLowestReaderOffset(e); if (target_offset == 0) return; - new_lowest_offset = (int) memFreeDataUpto(mem->data, - target_offset); + new_lowest_offset = (int) memFreeDataUpto(mem->data, target_offset); store_mem_size -= new_lowest_offset - old_lowest_offset; mem->e_lowest_offset = new_lowest_offset; } @@ -2199,13 +2198,12 @@ storeClientCopy(StoreEntry * e, sc->copy_offset = copy_offset; return; } + if (BIT_TEST(e->flag, DELETE_BEHIND)) + storeDeleteBehind(e); sz = memCopy(mem->data, copy_offset, buf, size); recurse_detect++; callback(data, buf, sz); recurse_detect--; - /* see if we can get rid of some data if we are in "delete behind" mode . */ - if (BIT_TEST(e->flag, DELETE_BEHIND)) - storeDeleteBehind(e); } static int