From bc2f604de8f54aeb5753bd532cc751f36eaab7c8 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 12 May 1999 02:14:14 +0000 Subject: [PATCH] Markus Leutwyler wrote: >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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ftp.cc b/src/ftp.cc index d19077583a..37c6a389e3 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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); } -- 2.47.3