From 177dbc7be07125582ddb7416dba7140b88ab9f62 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Jan 2005 22:13:12 +0000 Subject: Ian Ford asked about support for the FTP command ACCT, and I discovered it is present in RFC959... so now (lib)curl supports it as well. --ftp-account and CURLOPT_FTP_ACCOUNT set the account string. (The server may ask for an account string after PASS have been sent away. The client responds with "ACCT [account string]".) Added test case 228 and 229 to verify the functionality. Updated the test FTP server to support ACCT somewhat. --- src/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 708b8124d..14f34fac1 100644 --- a/src/main.c +++ b/src/main.c @@ -548,7 +548,7 @@ struct Configurable { struct curl_slist *tp_quote; struct curl_slist *tp_postquote; struct curl_slist *tp_prequote; - + char *ftp_account; /* for ACCT */ }; /* global variable to hold info about libcurl */ @@ -1249,10 +1249,10 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ {"$g", "retry", TRUE}, {"$h", "retry-delay", TRUE}, {"$i", "retry-max-time", TRUE}, - {"$j", "3p-url", TRUE}, {"$k", "3p-user", TRUE}, {"$l", "3p-quote", TRUE}, + {"$m", "ftp-account", TRUE}, {"0", "http1.0", FALSE}, {"1", "tlsv1", FALSE}, @@ -1631,6 +1631,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ break; /* break */ + case 'm': /* --ftp-account */ + GetStr(&config->ftp_account, nextarg); + break; } break; case '#': /* added 19990617 larsa */ @@ -2830,6 +2833,8 @@ static void free_config_fields(struct Configurable *config) free(config->tp_url); if(config->tp_user) free(config->tp_user); + if(config->ftp_account) + free(config->ftp_account); curl_slist_free_all(config->quote); /* checks for config->quote == NULL */ curl_slist_free_all(config->prequote); @@ -3655,12 +3660,13 @@ operate(struct Configurable *config, int argc, char *argv[]) curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); } - /* curl 7.12.4 */ + /* curl 7.13.0 */ curl_easy_setopt(curl, CURLOPT_SOURCE_URL, config->tp_url); curl_easy_setopt(curl, CURLOPT_SOURCE_USERPWD, config->tp_user); curl_easy_setopt(curl, CURLOPT_SOURCE_PREQUOTE, config->tp_prequote); curl_easy_setopt(curl, CURLOPT_SOURCE_POSTQUOTE, config->tp_postquote); curl_easy_setopt(curl, CURLOPT_SOURCE_QUOTE, config->tp_quote); + curl_easy_setopt(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account); retry_numretries = config->req_retry; -- cgit v1.2.3