From: Alex Rousskov Date: Wed, 7 Mar 2012 02:32:24 +0000 (-0700) Subject: Bug 3458: Icon Serving (squid-internal-static) Broken X-Git-Tag: BumpSslServerFirst.take06~2^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5426f8fd9c150fb94baf6bdedf3a08875bde96b;p=thirdparty%2Fsquid.git Bug 3458: Icon Serving (squid-internal-static) Broken --- diff --git a/ChangeLog b/ChangeLog index e2c4e07ec5..93e749194e 100644 --- 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 diff --git a/src/store.cc b/src/store.cc index 1c9a9e18a0..eb55af882d 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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 */ diff --git a/src/store_dir.cc b/src/store_dir.cc index 5303ce3864..2d503c84b9 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -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);