]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 3686: cache_dir max-size default fails
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 16 Feb 2013 02:26:31 +0000 (19:26 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 16 Feb 2013 02:26:31 +0000 (19:26 -0700)
commit6c2358fc65b68efe2590e1b2bfc094f51df4c576
tree3962b13d91445d7106f627a95d0ea85210a44480
parentec86b350b083dd1c9969b2a88c03370fc8a46cf6
Bug 3686: cache_dir max-size default fails

If some cache_dir are configured with max-size and some not the default
maximum_object_size limit fails.

This refactors the max-size management code such that each SwapDir always
has a value maxObjectSize(). This value is calculated from the SwapDir
local setting or global limit as appropriate.

The global maximum_object_size directive is migrated to simply be a default
for cache_dir max-size= option.

The global store_maxobjsize variable is altered to be the overall global
limit on how big an object may be cache by this proxy. It now takes into
account the max-size for all cache_dir and cache_mem limitation.

NP: The slow accumulation of these and earlier changes means Squid no
longer immediately caches unknown-length objects. The unit-tests are
therefore changed to test using explicit 0-length objects to ensure the
test is on a cached object not bypassing the apparently ested logic.
They are also provided with a large global store_maxobjsize limit in order
to do a weak test of the SwapDir types max-size in the presence of other
larger cache_dir or maximum_object_size settings.
src/SwapDir.cc
src/SwapDir.h
src/cache_cf.cc
src/cf.data.pre
src/fs/rock/RockIoState.cc
src/store.cc
src/store_dir.cc
src/store_swapout.cc
src/tests/testRock.cc
src/tests/testUfs.cc