From: Anatoli Date: Fri, 2 May 2014 07:47:32 +0000 (-0700) Subject: Fix order dependency between cache_dir and maximum_object_size X-Git-Tag: SQUID_3_4_5~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e667fd9ba719cda161447107117ef80b7fed1e3;p=thirdparty%2Fsquid.git Fix order dependency between cache_dir and maximum_object_size parse_cachedir() has a call to update_maxobjsize() which limits the store_maxobjsize variable used as the internal maximum_object_size variable of the store data structure) to the value of maximum_object_size defined at the moment of execution of this function, for all stores (all store directories). So if parse for cache_dir is called before maximum_object_size, we get the effect of the default 4 MB. BUT, when we get to parse maximum_object_size line(s) after the last cache_dir, the maximum_object_size option is processed and only shown on the cachemgr config page without having updated store_maxobjsize. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 9b279b01fa..38ac506212 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -723,6 +723,7 @@ configDoConfigure(void) #endif storeConfigure(); + update_maxobjsize(); // check for late maximum_object_size directive snprintf(ThisCache, sizeof(ThisCache), "%s (%s)", uniqueHostname(), diff --git a/src/cf.data.pre b/src/cf.data.pre index 61c36e4f82..88f4c0c6e0 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -3358,9 +3358,7 @@ TYPE: b_int64_t DEFAULT: 4 MB LOC: Config.Store.maxObjectSize DOC_START - Set the default value for max-size parameter on any cache_dir - which follow. - + Set the default value for max-size parameter on any cache_dir. The value is specified in bytes, and the default is 4 MB. If you wish to get a high BYTES hit ratio, you should probably @@ -3535,10 +3533,9 @@ DOC_START max-size=n the maximum object size in bytes this cache_dir supports. - The value in maximum_object_size directive above - this cache_dir line sets a default unless more - specific details are available (ie a small store - capacity). + The value in maximum_object_size directive sets + the default unless more specific details are + available (ie a small store capacity). Note: To make optimal use of the max-size limits you should order the cache_dir lines with the smallest max-size value first.