Re: [squid-users] unsupported Range

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 13 Apr 2001 16:45:54 +0200

Right. It got fixed and then broken again some months later.

The attached patch should again correct the problem. Please try the
patch and then report back to me.

--
Henrik Nordstrom
Squid Hacker
Denis Shaposhnikov wrote:
> 
> >>>>> "Henrik" == Henrik Nordstrom <hno@hem.passagen.se> writes:
> 
>  Henrik> Which Squid version are you using?  This is supposed to be
>  Henrik> fixed in current Squid versions.
> 
> 2.4.STABLE1
> 
>  >> client send request for URL to Squid using Range header. Squid
>  >> send this request to server. But server don't know Range and reply
>  >> whole file. Squid receive this file and reply to client requested
>  >> range, not whole file. This is real DOS. If server don't know
>  >> Range, Squid must reply to client whole file. How must I tune
>  >> Squid for it?
> 
> --
> DSS5-RIPE DSS-RIPN 2:550/5068@fidonet 2:550/5069@fidonet
> mailto:dsh@vlink.ru http://neva.vlink.ru/~dsh/

Index: commit/src/client_side.c
===================================================================
RCS file: /home/henrik/SRC/squid/SQUIDCACHE/cvs-server/squid//squid/src/client_side.c,v
retrieving revision 1.532
diff -u -w -r1.532 client_side.c
--- commit/src/client_side.c 2001/03/04 00:54:48 1.532
+++ commit/src/client_side.c 2001/04/13 14:41:46
@@ -1147,6 +1147,7 @@
     HttpHeader *hdr = rep ? &rep->header : 0;
     const char *range_err = NULL;
     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)
@@ -1167,6 +1168,8 @@
         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 && httpHdrRangeOffsetLimit(http->request->range))
+ 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 Fri Apr 13 2001 - 08:45:20 MDT

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