From: Amos Jeffries Date: Fri, 3 Jul 2009 00:46:04 +0000 (+1200) Subject: Bug 1338: File prefetches aborted despite range_offset X-Git-Tag: SQUID_3_1_0_10~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ac4f3615a09e929ec283b56cf077be19cd18e9c;p=thirdparty%2Fsquid.git Bug 1338: File prefetches aborted despite range_offset --- diff --git a/src/cf.data.pre b/src/cf.data.pre index 55fc225a67..9d43cd75a2 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -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 diff --git a/src/store_client.cc b/src/store_client.cc index c6ead68240..6e3c3b3cf8 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -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;