diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftp.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -1790,8 +1790,20 @@ static CURLcode ftp_state_quote(struct connectdata *conn, result = ftp_state_retr(conn, ftpc->known_filesize); } else { - PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file); - state(conn, FTP_RETR_SIZE); + 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.*/ + PPSENDF(&ftpc->pp, "RETR %s", ftpc->file); + state(conn, FTP_RETR); + } + else { + PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file); + state(conn, FTP_RETR_SIZE); + } } } break; |