aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-07-25 22:45:21 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-07-25 22:45:21 +0000
commit2527b5301946539363754a390974cdd3a3d34485 (patch)
treecb3118d3490244ef1ed0e9ca624501ec60e3fe24 /src/main.c
parent78a47826b26d666586dc98028f38b5a0d6f59ad2 (diff)
Dan Nelson added the CURLOPT_FTP_ALTERNATIVE_TO_USER libcurl option and curl
tool option named --ftp-alternative-to-user. It provides a mean to send a particular command if the normal USER/PASS approach fails.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 3e717a3d2..af20a396c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -353,6 +353,7 @@ struct Configurable {
struct curl_slist *tp_postquote;
struct curl_slist *tp_prequote;
char *ftp_account; /* for ACCT */
+ char *ftp_alternative_to_user; /* send command if USER/PASS fails */
int ftp_filemethod;
bool ignorecl; /* --ignore-content-length */
@@ -1340,6 +1341,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
{"$r", "ftp-method", TRUE},
{"$s", "local-port", TRUE},
{"$t", "socks4", TRUE},
+ {"$u", "ftp-alternative-to-user", TRUE},
{"0", "http1.0", FALSE},
{"1", "tlsv1", FALSE},
@@ -1776,6 +1778,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
}
}
break;
+ case 'u': /* --ftp-alternative-to-user */
+ GetStr(&config->ftp_alternative_to_user, nextarg);
+ break;
}
break;
case '#': /* --progress-bar */
@@ -3998,6 +4003,9 @@ operate(struct Configurable *config, int argc, char *argv[])
curl_easy_setopt(curl, CURLOPT_LOCALPORTRANGE, config->localportrange);
}
+ /* curl x.xx.x */
+ curl_easy_setopt(curl, CURLOPT_FTP_ALTERNATIVE_TO_USER, config->ftp_alternative_to_user);
+
retry_numretries = config->req_retry;
retrystart = curlx_tvnow();