------------------------------------------------------------ revno: 13149 revision-id: squid3@treenet.co.nz-20140621042113-lwwbom7bdrgmo38b parent: squid3@treenet.co.nz-20140621041958-5do73p637eaeoljr author: Christos Tsantilas committer: Amos Jeffries branch nick: 3.4 timestamp: Fri 2014-06-20 22:21:13 -0600 message: Assure that when LruMap::memLimit_ is set to 0 no entries stored on LruMap Changes: - Do not add new entries to LruMap if memLimit is 0 - Remove all entries in LruMap::trim if memLimit set to 0 ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140621042113-lwwbom7bdrgmo38b # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # testament_sha1: 81697203f826ded718200499153b8de0498ad165 # timestamp: 2014-06-21 04:25:02 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # base_revision_id: squid3@treenet.co.nz-20140621041958-\ # 5do73p637eaeoljr # # Begin patch === modified file 'src/base/LruMap.h' --- src/base/LruMap.h 2014-03-04 10:14:42 +0000 +++ src/base/LruMap.h 2014-06-21 04:21:13 +0000 @@ -143,6 +143,10 @@ del(key); trim(); + + if (memLimit() == 0) + return false; + index.push_front(new Entry(key, t)); storage.insert(MapPair(key, index.begin())); @@ -188,7 +192,7 @@ void LruMap::trim() { - while (memLimit() > 0 && size() >= memLimit()) { + while (size() >= memLimit()) { QueueIterator i = index.end(); --i; if (i != index.end()) {