diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-02-08 16:40:34 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-02-09 14:06:28 +0100 |
commit | 528f71c2ecdbb03117af226978804148d69a1007 (patch) | |
tree | 1345d18162135945aff7657f539071c6b4019437 /lib/ftp.c | |
parent | 115c9e27f53809a254fba44b023bea92f4d4dcd0 (diff) | |
download | curl-528f71c2ecdbb03117af226978804148d69a1007.tar.gz |
ftp: add 'list_only' to the transfer state struct
and rename it from 'ftp_list_only' since it is also used for SSH and
POP3. The state is updated internally for 'type=D' FTP URLs.
Added test case 1570 to verify.
Closes #6578
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1378,7 +1378,7 @@ static CURLcode ftp_state_prepare_transfer(struct Curl_easy *data) result = Curl_pp_sendf(data, &ftpc->pp, "PRET %s", data->set.str[STRING_CUSTOMREQUEST]? data->set.str[STRING_CUSTOMREQUEST]: - (data->set.ftp_list_only?"NLST":"LIST")); + (data->state.list_only?"NLST":"LIST")); else if(data->set.upload) result = Curl_pp_sendf(data, &ftpc->pp, "PRET STOR %s", conn->proto.ftpc.file); @@ -1485,7 +1485,7 @@ static CURLcode ftp_state_list(struct Curl_easy *data) cmd = aprintf("%s%s%s", data->set.str[STRING_CUSTOMREQUEST]? data->set.str[STRING_CUSTOMREQUEST]: - (data->set.ftp_list_only?"NLST":"LIST"), + (data->state.list_only?"NLST":"LIST"), lstArg? " ": "", lstArg? lstArg: ""); free(lstArg); @@ -3648,7 +3648,7 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep) if(result) ; - else if(data->set.ftp_list_only || !ftpc->file) { + else if(data->state.list_only || !ftpc->file) { /* The specified path ends with a slash, and therefore we think this is a directory that is requested, use LIST. But before that we need to set ASCII transfer mode. */ @@ -4356,7 +4356,7 @@ static CURLcode ftp_setup_connection(struct Curl_easy *data, break; case 'D': /* directory mode */ - data->set.ftp_list_only = TRUE; + data->state.list_only = TRUE; break; case 'I': /* binary mode */ |