]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
hno squid-2.3.DEVEL3.internal_range_limit-2.patch
authorhno <>
Wed, 3 May 2000 02:24:44 +0000 (02:24 +0000)
committerhno <>
Wed, 3 May 2000 02:24:44 +0000 (02:24 +0000)
Squid-2.3.DEVEL3: Range request could cause bandwidth spikes

Range requests to servers/objects not supporting range requests could
cause bandwidth spikes and/or negative hit ratio.

ChangeLog
src/client_side.cc

index 6bc0136dbe19586487ad0b69c766adb8805cc927..421f6770b7925207b4f7a4576d43099e42d39671 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,9 @@ Changes to Squid-2.4.DEVEL3 ():
        - PURGE now also purges the DNS cache
        - HEAD on FTP objects no longer retreives the whole object
        - More cleanups of the dstdomain ACL type
+       - Squid no longer tries to do Range internally if it is not supported
+         by the origin server. Doing so could cause bandwidth spikes and/or
+         negative hit ratio.
 
 Changes to Squid-2.4.DEVEL2 ():
 
index 56bf036de94342f8e674747c318c3aea733ed925..11f1641cdda99d6d08fd20bf9708b9bfa149bf04 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.477 2000/05/02 20:18:21 hno Exp $
+ * $Id: client_side.cc,v 1.478 2000/05/02 20:24:44 hno Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1076,7 +1076,9 @@ clientBuildRangeHeader(clientHttpRequest * http, HttpReply * rep)
 {
     HttpHeader *hdr = rep ? &rep->header : 0;
     const char *range_err = NULL;
-    assert(http->request->range);
+    request_t *request = http->request;
+    int is_hit = isTcpHit(http->log_type);
+    assert(request->range);
     /* check if we still want to do ranges */
     if (!rep)
        range_err = "no [parse-able] reply";
@@ -1094,6 +1096,11 @@ clientBuildRangeHeader(clientHttpRequest * http, HttpReply * rep)
        range_err = "canonization failed";
     else if (httpHdrRangeIsComplex(http->request->range))
        range_err = "too complex range header";
+    else if (!request->flags.cachable) /* from we_do_ranges in http.c */
+       range_err = "non-cachable request";
+    else if (!is_hit && Config.rangeOffsetLimit < httpHdrRangeFirstOffset(request->range)
+           && Config.rangeOffsetLimit != -1) /* from we_do_ranges in http.c */
+       range_err = "range outside range_offset_limit";
     /* get rid of our range specs on error */
     if (range_err) {
        debug(33, 3) ("clientBuildRangeHeader: will not do ranges: %s.\n", range_err);