diff options
author | Daniel Stenberg <daniel@haxx.se> | 2010-01-01 14:44:44 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-01-01 14:44:44 +0000 |
commit | 605bbfc4c0fa838f50bf9d18e69e417168f524c0 (patch) | |
tree | 405fa3f29adea6bacbaad6b1edf8ad8f9e5b718a /src | |
parent | 42d365f199f9637820de4ecdee21bc7d4668f138 (diff) |
- Ingmar Runge enhanced libcurl's FTP engine to support the PRET command. This
command is a special "hack" used by the drftpd server, but even though it is
a custom extension I've deemed it fine to add to libcurl since this server
seems to survive and people keep using it and want libcurl to support
it. The new libcurl option is named CURLOPT_FTP_USE_PRET, and it is also
usable from the curl tool with --ftp-pret. Using this option on a server
that doesn't support this command will make libcurl fail.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index 09d4c827b..cd875e723 100644 --- a/src/main.c +++ b/src/main.c @@ -477,6 +477,7 @@ struct Configurable { bool resume_from_current; bool disable_epsv; bool disable_eprt; + bool ftp_pret; curl_off_t resume_from; char *postfields; curl_off_t postfieldsize; @@ -794,6 +795,7 @@ static void help(void) " --ftp-pasv Use PASV/EPSV instead of PORT (F)", " -P/--ftp-port <address> Use PORT with address instead of PASV (F)", " --ftp-skip-pasv-ip Skip the IP address for PASV (F)\n" + " --ftp-pret Send PRET before PASV (for drftpd) (F)", " --ftp-ssl Try SSL/TLS for ftp transfer (F)", " --ftp-ssl-ccc Send CCC after authenticating (F)", " --ftp-ssl-ccc-mode [active/passive] Set CCC mode (F)", @@ -1746,6 +1748,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ {"$9", "tftp-blksize", TRUE}, {"$A", "mail-from", TRUE}, {"$B", "mail-rcpt", TRUE}, + {"$C", "ftp-pret", FALSE}, {"0", "http1.0", FALSE}, {"1", "tlsv1", FALSE}, {"2", "sslv2", FALSE}, @@ -2284,6 +2287,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ if(err) return err; break; + case 'C': /* --ftp-pret */ + config->ftp_pret = toggle; + break; } break; case '#': /* --progress-bar */ @@ -5032,6 +5038,10 @@ operate(struct Configurable *config, int argc, argv_item_t argv[]) if(config->mail_rcpt) my_setopt_str(curl, CURLOPT_MAIL_RCPT, config->mail_rcpt); + /* curl 7.20.x */ + if(config->ftp_pret) + my_setopt(curl, CURLOPT_FTP_USE_PRET, TRUE); + retry_numretries = config->req_retry; retrystart = cutil_tvnow(); |