]> git.ipfire.org Git - thirdparty/squid.git/commit
Restored Squid ability to cache (in memory) when no disk caches are configured
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 18 Apr 2014 16:57:01 +0000 (10:57 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 18 Apr 2014 16:57:01 +0000 (10:57 -0600)
commit3c856e95a672cd23da7eaebbfd07686dac4464ef
tree127de76e7d18863504fd8b5967ca93c4dc7de8fd
parent636b913cdf2421ad1527aed11814b0c410f7bfd6
Restored Squid ability to cache (in memory) when no disk caches are configured
which was lost during r12662 "Bug 3686: cache_dir max-size default fails"

The bug was hidden until the memory cache code started calling
StoreEntry::checkCachable() in branch r13315, exposing the entry size check to
a broken limit.

r12662 converted store_maxobjsize from a sometimes present disk-only limit to
an always set Squid-global limit. However, store_maxobjsize value was only
calculated when parsing cache_dirs. A config without cache_dirs would leave
store_maxobjsize at -1, triggering "StoreEntry::checkCachable: NO: too big"
prohibition for all responses.

This change moves store_maxobjsize calculation from parser to storeConfigure()
where some other Store globals are computed after squid.conf parsing.

Also honored memory cache size limit (just in case cache_mem is smaller than
maximum_object_size_in_memory) and removed leftover checks for
store_maxobjsize being set (it should always be set, at least to zero).
src/cache_cf.cc
src/globals.h
src/store.cc
src/store_swapout.cc