]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Markus Leutwyler wrote:
authorwessels <>
Wed, 12 May 1999 02:14:14 +0000 (02:14 +0000)
committerwessels <>
Wed, 12 May 1999 02:14:14 +0000 (02:14 +0000)
>I have attached two logfiles (cache.log .. taken with debug = all,9)
>that show the different behaviour between the small text file and the
>bigger binary file. The FTP server is replying to the SIZE command with
>"213 0" (0 bytes) and this is sent to the browser as Content-length. I
>just wonder why the text file works and the binary file not. Could
>someone look at the logfile and try to figure out what's going on
>exactly?

Henrik:
SIZE is only used on binary transfers, not text transfers.  Attached is
a small workaround which causes Squid to ignore 0 replies to SIZE.

src/ftp.cc

index d19077583a9d197ba31ddb24776b2025292d8ba1..37c6a389e311fbd6ae53d4467935b3093342a867 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.283 1999/05/04 21:58:22 wessels Exp $
+ * $Id: ftp.cc,v 1.284 1999/05/11 20:14:14 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -1597,6 +1597,12 @@ ftpReadSize(FtpStateData * ftpState)
     if (code == 213) {
        ftpUnhack(ftpState);
        ftpState->size = atoi(ftpState->ctrl.last_reply);
+       if (ftpState->size == 0) {
+           debug(9, 2) ("ftpReadSize: SIZE reported %s on %s\n",
+               ftpState->ctrl.last_reply,
+               ftpState->title_url);
+           ftpState->size = -1;
+       }
     } else if (code < 0) {
        ftpFail(ftpState);
     }