ftp: support growing files with CURLOPT_IGNORE_CONTENT_LENGTH

When using the option CURLOPT_IGNORE_CONTENT_LENGTH (set.ignorecl in
code) to support growing files in FTP, the code should ignore the
initial size it gets from the server as this will not be the final size
of the file. This is done in ftp_state_quote() to prevent a size request
being issued in the initial sequence. However, in a later call to
ftp_state_get_resp() the code attempts to get the size of the content
again if it doesn't already have it, by parsing the response from the
RETR request. This fix prevents this parsing of the response to get the
size when the set.ignorecl option is set. This should maintain the size
value as -1, unknown, in this situation.

Closes #9772
This commit is contained in:
fractal-access 2022-10-19 14:37:44 +01:00 committed by Daniel Stenberg
parent f18956d0ca
commit 76b3f5f2cf
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -2448,6 +2448,7 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data,
if((instate != FTP_LIST) &&
!data->state.prefer_ascii &&
!data->set.ignorecl &&
(ftp->downloadsize < 1)) {
/*
* It seems directory listings either don't show the size or very