ftp: fix prequotes for a directory in URL

Allow prequotes to be sent after curl has changed the working directory,
just before the listing command if the URL is a directory.

FTP state machine is updated with the new FTP_LIST_PREQUOTE state and
FTP_RETR_LIST_TYPE type.

Test 754 verifies

Fixes #8602
Closes #17616
This commit is contained in:
Bartosz Ruszczak 2025-03-14 21:53:42 +01:00 committed by Daniel Stenberg
parent 149d436457
commit fdf50d64b8
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 96 additions and 4 deletions

View file

@ -62,12 +62,14 @@ enum {
FTP_QUOTE, /* waiting for a response to a command sent in a quote list */
FTP_RETR_PREQUOTE,
FTP_STOR_PREQUOTE,
FTP_LIST_PREQUOTE,
FTP_POSTQUOTE,
FTP_CWD, /* change dir */
FTP_MKD, /* if the dir did not exist */
FTP_MDTM, /* to figure out the datestamp */
FTP_TYPE, /* to set type when doing a head-like request */
FTP_LIST_TYPE, /* set type when about to do a dir list */
FTP_RETR_LIST_TYPE,
FTP_RETR_TYPE, /* set type when about to RETR a file */
FTP_STOR_TYPE, /* set type when about to STOR a file */
FTP_SIZE, /* get the remote file's size for head-like request */