From: Daniel Stenberg Date: Thu, 27 Feb 2003 12:50:54 +0000 (+0000) Subject: It appears that there are FTP-servers that return size 0 for files X-Git-Tag: curl-7_10_4~116 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52ebf506074c6ab2e3653563f589574f6227616d;p=curl It appears that there are FTP-servers that return size 0 for files when SIZE is used on the file while being in BINARY mode. To work around that (stupid) behavior, we attempt to parse the RETR response even if the SIZE returned size zero. Debugging help from Salvatore Sorrentino on February 26, 2003. --- diff --git a/lib/ftp.c b/lib/ftp.c index c7246446c..710bee925 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -1854,9 +1854,19 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn) int size=-1; /* default unknown size */ + + /* + * It appears that there are FTP-servers that return size 0 for files + * when SIZE is used on the file while being in BINARY mode. To work + * around that (stupid) behavior, we attempt to parse the RETR response + * even if the SIZE returned size zero. + * + * Debugging help from Salvatore Sorrentino on February 26, 2003. + */ + if(!dirlist && !data->set.ftp_ascii && - (-1 == downloadsize)) { + (downloadsize < 1)) { /* * It seems directory listings either don't show the size or very * often uses size 0 anyway. ASCII transfers may very well turn out