]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Objects of unknown size are allowed into non-shared memory cache
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 11 May 2011 23:04:21 +0000 (17:04 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 11 May 2011 23:04:21 +0000 (17:04 -0600)
src/store.cc

index 2113b126abc0678afa993bbff31cfc1b3f243170..c4ffa93b5c4daf94fc78e7451695df0bd0a63e63 100644 (file)
@@ -1443,11 +1443,13 @@ StoreEntry::memoryCachable() const
     if (!Config.onoff.memory_cache_first && swap_status == SWAPOUT_DONE && refcount == 1)
         return 0;
 
-    const int64_t expectedSize = mem_obj->expectedReplySize();
-    // objects of unknown size are not allowed into the memory cache, for now
-    if (expectedSize < 0 ||
-        expectedSize > static_cast<int64_t>(Config.Store.maxInMemObjSize))
-        return 0;
+    if (UsingSmp()) {
+        const int64_t expectedSize = mem_obj->expectedReplySize();
+        // objects of unknown size are not allowed into memory cache, for now
+        if (expectedSize < 0 ||
+            expectedSize > static_cast<int64_t>(Config.Store.maxInMemObjSize))
+            return 0;
+    }
 
     return 1;
 }