]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 1338: File prefetches aborted despite range_offset
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 28 Jun 2009 11:47:27 +0000 (23:47 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 28 Jun 2009 11:47:27 +0000 (23:47 +1200)
src/cf.data.pre
src/store_client.cc

index 7f42fccdcc5b486649aeec1c12c6bed91a1cfe90..963c55e51876a68e1b807a9bfac550f78c0de7b7 100644 (file)
@@ -3172,11 +3172,16 @@ DOC_START
        from making Squid fetch the whole object up to that point before
        sending anything to the client.
 
+       A value of 0 causes Squid to never fetch more than the
+       client requested. (default)
+
        A value of -1 causes Squid to always fetch the object from the
        beginning so it may cache the result. (2.0 style)
 
-       A value of 0 causes Squid to never fetch more than the
-       client requested. (default)
+       NP: Using -1 here will override any quick_abort settings that may
+           otherwise apply to the range request. The range request will
+           be fully fetched from start to finish regardless of the client
+           actions. This affects bandwidth usage.
 DOC_END
 
 NAME: minimum_expiry_time
index c6ead68240dbde5853b276b1333d72121f2262f0..6e3c3b3cf88b04ad452f7019358a73a66dcce46b 100644 (file)
@@ -769,6 +769,12 @@ CheckQuickAbort2(StoreEntry * entry)
         return 0;
     }
 
+    if ( Config.rangeOffsetLimit < 0 && mem->request && mem->request->range ) {
+        /* Don't abort if the admin has configured range_ofset -1 to download fully for caching. */
+        debugs(90, 3, "CheckQuickAbort2: NO admin configured range replies to full-download");
+        return 0;
+    }
+
     if (curlen > expectlen) {
         debugs(90, 3, "CheckQuickAbort2: YES bad content length");
         return 1;