]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix order dependency between cache_dir and maximum_object_size
authorAnatoli <me@anatoli.ws>
Fri, 2 May 2014 07:47:32 +0000 (00:47 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 2 May 2014 07:47:32 +0000 (00:47 -0700)
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.

src/cache_cf.cc
src/cf.data.pre

index 9b279b01fa9440276194f03bc3ff9fa208df2634..38ac506212330823aa333e8af1a933dd717a9179 100644 (file)
@@ -723,6 +723,7 @@ configDoConfigure(void)
 #endif
 
     storeConfigure();
+    update_maxobjsize(); // check for late maximum_object_size directive
 
     snprintf(ThisCache, sizeof(ThisCache), "%s (%s)",
              uniqueHostname(),
index 61c36e4f82594cd5050e6e2f48704a6aa01e552c..88f4c0c6e0e61c35bbba1f6d43276287829122db 100644 (file)
@@ -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.