diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-02-04 13:05:03 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-02-04 23:06:03 +0100 |
commit | e32601e13ab258a4370b46f8c5d360eab9d5ee8f (patch) | |
tree | 2b6c73a6ed15b4bcf6f2cbdec66883fcd43966c6 /lib/ftp.c | |
parent | 5f08a5acd5380e41b8966dae96241bd1b4889b2c (diff) | |
download | curl-e32601e13ab258a4370b46f8c5d360eab9d5ee8f.tar.gz |
ftp: avoid SIZE when asking for a TYPE A file
... as we ignore it anyway because servers don't report the correct size
and proftpd even blatantly returns a 550.
Updates a set of tests accordingly.
Reported-by: awesomenode on github
Fixes #6564
Closes #6565
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -1747,13 +1747,19 @@ static CURLcode ftp_state_quote(struct Curl_easy *data, result = ftp_state_retr(data, ftpc->known_filesize); } else { - if(data->set.ignorecl) { - /* This code is to support download of growing files. It prevents - the state machine from requesting the file size from the - server. With an unknown file size the download continues until - the server terminates it, otherwise the client stops if the - received byte count exceeds the reported file size. Set option - CURLOPT_IGNORE_CONTENT_LENGTH to 1 to enable this behavior.*/ + if(data->set.ignorecl || data->set.prefer_ascii) { + /* 'ignorecl' is used to support download of growing files. It + prevents the state machine from requesting the file size from + the server. With an unknown file size the download continues + until the server terminates it, otherwise the client stops if + the received byte count exceeds the reported file size. Set + option CURLOPT_IGNORE_CONTENT_LENGTH to 1 to enable this + behavior. + + In addition: asking for the size for 'TYPE A' transfers is not + constructive since servers don't report the converted size. So + skip it. + */ result = Curl_pp_sendf(data, &ftpc->pp, "RETR %s", ftpc->file); if(!result) state(data, FTP_RETR); |