aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-01-25 22:13:12 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-01-25 22:13:12 +0000
commit177dbc7be07125582ddb7416dba7140b88ab9f62 (patch)
tree427fa08bfdea3642ac8ecd19776b43b888b2bc24 /src
parentf2e71edcbd479345678bb03e76fad17157fc318e (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
1 files changed, 9 insertions, 3 deletions
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;