From 3ac4f3615a09e929ec283b56cf077be19cd18e9c Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 3 Jul 2009 12:46:04 +1200 Subject: [PATCH] Bug 1338: File prefetches aborted despite range_offset --- src/cf.data.pre | 9 +++++++-- src/store_client.cc | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) 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; -- 2.47.3