From: Alex Rousskov Date: Wed, 2 Nov 2011 21:18:50 +0000 (-0600) Subject: Fixed two more cases of outdated shared memory cache detection X-Git-Tag: BumpSslServerFirst.take01~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2c86cbda4632f4f8294b5ee7cdc869115e85516;p=thirdparty%2Fsquid.git Fixed two more cases of outdated shared memory cache detection which led to "STORE_DISK_CLIENT == getType()" assertions when running SMP Squid with non-shared memory caching. UsingSmp() is not the right condition to detect whether we are using a shared memory cache because shared memory caching may be disabled and because Coordinator does not use a shared memory cache even if shared caching is enabled. See also: r11821. --- diff --git a/src/store.cc b/src/store.cc index 22df2c87bb..7dbfc1d59e 100644 --- a/src/store.cc +++ b/src/store.cc @@ -316,7 +316,7 @@ StoreEntry::storeClientType() const * offset 0 in the memory object is the HTTP headers. */ - if (mem_status == IN_MEMORY && UsingSmp()) { + if (mem_status == IN_MEMORY && Config.memShared && IamWorkerProcess()) { // clients of an object cached in shared memory are memory clients return STORE_MEM_CLIENT; } @@ -1444,7 +1444,7 @@ StoreEntry::memoryCachable() const if (!Config.onoff.memory_cache_first && swap_status == SWAPOUT_DONE && refcount == 1) return 0; - if (UsingSmp()) { + if (Config.memShared && IamWorkerProcess()) { const int64_t expectedSize = mem_obj->expectedReplySize(); // objects of unknown size are not allowed into memory cache, for now if (expectedSize < 0 ||