>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.
/*
- * $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
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);
}