mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
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.
This commit is contained in:
parent
d34a4b126e
commit
52ebf50607
12
lib/ftp.c
12
lib/ftp.c
@ -1854,9 +1854,19 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
|||||||
|
|
||||||
int size=-1; /* default unknown size */
|
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 &&
|
if(!dirlist &&
|
||||||
!data->set.ftp_ascii &&
|
!data->set.ftp_ascii &&
|
||||||
(-1 == downloadsize)) {
|
(downloadsize < 1)) {
|
||||||
/*
|
/*
|
||||||
* It seems directory listings either don't show the size or very
|
* It seems directory listings either don't show the size or very
|
||||||
* often uses size 0 anyway. ASCII transfers may very well turn out
|
* often uses size 0 anyway. ASCII transfers may very well turn out
|
||||||
|
Loading…
Reference in New Issue
Block a user