]> git.ipfire.org Git - thirdparty/curl.git/commit
ftp: support growing files with CURLOPT_IGNORE_CONTENT_LENGTH
authorfractal-access <116177727+fractal-access@users.noreply.github.com>
Wed, 19 Oct 2022 13:37:44 +0000 (14:37 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 26 Nov 2022 16:02:54 +0000 (17:02 +0100)
commit76b3f5f2cf0f091720413690c49f8d0ada5bfae5
treec749870662d2a414fb9819c7fb1c91922fae0a76
parentf18956d0ca75eca21b800056ea0a245491e664e2
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
lib/ftp.c