range_offset_limit broken?

From: Duane Wessels <wessels@dont-contact.us>
Date: Thu, 13 Jul 2000 02:12:59 -0600

(thought this went out before, but qmail rejected it because
of empty subject line).

I don't understand why Config.rangeOffsetLimit is being checked in
clientBuildRangeHeader().

clientBuildRangeHeader generates reply headers going to the client.

Shouldn't Config.rangeOffsetLimit be checked before that? Like somewhere
in or around clientProcessRequest2()?

==============================================================================

RCS file: /server/cvs-server/squid/squid/src/client_side.c,v
retrieving revision 1.477
retrieving revision 1.478
diff -p -u -r1.477 -r1.478
--- squid/src/client_side.c 2000/05/02 20:18:21 1.477
+++ /server/cvs-server/squid/squid/src/client_side.c 2000/05/02 20:24:44 1.478
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.c,v 1.477 2000/05/02 20:18:21 hno Exp $
+ * $Id: client_side.c,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
 {
     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
        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);
Received on Thu Jul 13 2000 - 02:13:06 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:32 MST