]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3458: Icon Serving (squid-internal-static) Broken
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 7 Mar 2012 02:32:24 +0000 (19:32 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 7 Mar 2012 02:32:24 +0000 (19:32 -0700)
ChangeLog
src/store.cc
src/store_dir.cc

index e2c4e07ec57bb77347f615a5b5d261673fd997e8..93e749194eb245147825f200d3be7b869a451418 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@ Changes to squid-3.2.0.16 (07 Mar 2011):
        - Bug 3497: Bad ssl_crtd db size file causes infinite loop
        - Bug 3490: part 1: SegFault opening FTP active data connections
        - Bug 3490: Crash writing Apache Common and Referer/Useragent logs
+       - Bug 3458: Icon Serving (squid-internal-static) Broken
        - Bug 3457: Display TLS error details in ERR_SECURE_CONNECT_FAIL
        - Bug 3381: 32-bit overflow assertion in StatHist
        - Bug 3324: loadFromFile: parse error while reading template file
index 1c9a9e18a0dbcddca7b818f9ed7b9ecdca464067..eb55af882d7520798b18abb4d6857f24b7bea3e0 100644 (file)
@@ -1637,7 +1637,8 @@ StoreEntry::setMemStatus(mem_status_t new_status)
 
     // are we using a shared memory cache?
     if (Config.memShared && IamWorkerProcess()) {
-        assert(new_status != IN_MEMORY); // we do not call this otherwise
+        // enumerate calling cases if shared memory is enabled
+        assert(new_status != IN_MEMORY || EBIT_TEST(flags, ENTRY_SPECIAL));
         // This method was designed to update replacement policy, not to
         // actually purge something from the memory cache (TODO: rename?).
         // Shared memory cache does not have a policy that needs updates.
@@ -1902,6 +1903,9 @@ StoreEntry::trimMemory(const bool preserveSwappable)
     if (mem_status == IN_MEMORY)
         return;
 
+    if (EBIT_TEST(flags, ENTRY_SPECIAL))
+        return; // cannot trim because we do not load them again
+
     if (!preserveSwappable) {
         if (mem_obj->policyLowestOffsetToKeep(0) == 0) {
             /* Nothing to do */
index 5303ce3864a149e322098c380c7c9c79c1a99a6e..2d503c84b929906d8b62ebd7f90139597333cfc2 100644 (file)
@@ -685,6 +685,10 @@ free_cachedir(SquidConfig::_cacheSwap * swap)
 void
 StoreController::reference(StoreEntry &e)
 {
+    // special entries do not belong to any specific Store, but are IN_MEMORY
+    if (EBIT_TEST(e.flags, ENTRY_SPECIAL))
+        return;
+
     /* Notify the fs that we're referencing this object again */
 
     if (e.swap_dirn > -1)
@@ -706,6 +710,10 @@ StoreController::dereference(StoreEntry & e)
 {
     bool keepInStoreTable = true; // keep if there are no objections
 
+    // special entries do not belong to any specific Store, but are IN_MEMORY
+    if (EBIT_TEST(e.flags, ENTRY_SPECIAL))
+        return keepInStoreTable;
+
     /* Notify the fs that we're not referencing this object any more */
 
     if (e.swap_filen > -1)
@@ -777,6 +785,13 @@ void
 StoreController::handleIdleEntry(StoreEntry &e)
 {
     bool keepInLocalMemory = false;
+
+    if (EBIT_TEST(e.flags, ENTRY_SPECIAL)) {
+        // Icons (and cache digests?) should stay in store_table until we
+        // have a dedicated storage for them (that would not purge them).
+        // They are not managed [well] by any specific Store handled below.
+        keepInLocalMemory = true;
+    } else
     if (memStore) {
         memStore->considerKeeping(e);
         // leave keepInLocalMemory false; memStore maintains its own cache
@@ -794,6 +809,8 @@ StoreController::handleIdleEntry(StoreEntry &e)
         return;
     }
 
+    debugs(20, 5, HERE << "keepInLocalMemory: " << keepInLocalMemory);
+
     // TODO: move this into [non-shared] memory cache class when we have one
     if (keepInLocalMemory) {
         e.setMemStatus(IN_MEMORY);