Re: ftp requests with ranges ?

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Tue, 24 Nov 1998 16:05:01 -0700 (MST)

Zarochentcev Alexander complains:

> My Squid 2.1-Release fails when receives 'ftp' requests with
> ranges.

Mine too! :)
Please try the patch attached.

Thanks,

Alex.

Index: client_side.c
===================================================================
RCS file: /surf1/CVS/squid/src/client_side.c,v
retrieving revision 1.420.2.9
diff -u -r1.420.2.9 client_side.c
--- client_side.c 1998/11/11 23:04:22 1.420.2.9
+++ client_side.c 1998/11/24 22:23:00
@@ -1401,7 +1401,6 @@
     /* check: reply was parsed and range iterator was initialized */
     assert(i->prefix_size > 0);
     /* filter out data according to range specs */
- /* note: order of loop conditions is significant! */
     while (clientCanPackMoreRanges(http, i, size)) {
         off_t start; /* offset of still missing data */
         assert(i->spec);
@@ -1549,23 +1548,21 @@
         httpReplyDestroy(rep);
         rep = NULL;
     } else {
- /* leave space for growth incase we do ranges */
+ /* leave space for growth in case we do ranges */
         memBufInit(&mb, CLIENT_SOCK_SZ, 2 * CLIENT_SOCK_SZ);
     }
     /* append body if any */
- if (body_buf && body_size) {
- if (http->request->range) {
- /* Only GET requests should have ranges */
- assert(http->request->method == METHOD_GET);
- /* clientPackMoreRanges() updates http->out.offset */
- /* force the end of the transfer if we are done */
- if (!clientPackMoreRanges(http, body_buf, body_size, &mb))
- http->flags.done_copying = 1;
- } else {
- http->out.offset += body_size;
- check_size += body_size;
- memBufAppend(&mb, body_buf, body_size);
- }
+ if (http->request->range) {
+ /* Only GET requests should have ranges */
+ assert(http->request->method == METHOD_GET);
+ /* clientPackMoreRanges() updates http->out.offset */
+ /* force the end of the transfer if we are done */
+ if (!clientPackMoreRanges(http, body_buf, body_size, &mb))
+ http->flags.done_copying = 1;
+ } else if (body_buf && body_size) {
+ http->out.offset += body_size;
+ check_size += body_size;
+ memBufAppend(&mb, body_buf, body_size);
     }
     if (!http->request->range && http->request->method == METHOD_GET)
         assert(check_size == size);
Received on Tue Nov 24 1998 - 16:06:24 MST

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