]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed two more cases of outdated shared memory cache detection
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 2 Nov 2011 21:18:50 +0000 (15:18 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 2 Nov 2011 21:18:50 +0000 (15:18 -0600)
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.

src/store.cc

index 22df2c87bb3f0dc21f5ee72886a6c3c127cb7eb5..7dbfc1d59e5c4e17112ace88fd3fce6ceb3b61f2 100644 (file)
@@ -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 ||