aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/curl.113
-rw-r--r--docs/examples/ftp3rdparty.c47
-rw-r--r--docs/libcurl/curl_easy_setopt.316
3 files changed, 49 insertions, 27 deletions
diff --git a/docs/curl.1 b/docs/curl.1
index f9faadbda..3556d1ce6 100644
--- a/docs/curl.1
+++ b/docs/curl.1
@@ -21,7 +21,7 @@
.\" * $Id$
.\" **************************************************************************
.\"
-.TH curl 1 "20 Jan 2005" "Curl 7.12.4" "Curl Manual"
+.TH curl 1 "20 Jan 2005" "Curl 7.13.0" "Curl Manual"
.SH NAME
curl \- transfer a URL
.SH SYNOPSIS
@@ -1065,6 +1065,17 @@ Forces curl to use SSL version 2 when negotiating with a remote SSL server.
.IP "-3/--sslv3"
(HTTPS)
Forces curl to use SSL version 3 when negotiating with a remote SSL server.
+.IP "--3p-quote"
+(FTP) Specify arbitrary commands to send to the source server. See the
+\fI-Q/--quote\fP option for details. (Added in 7.13.0)
+.IP "--3p-url"
+(FTP) Activates a FTP 3rd party transfer. Specifies the source URL to get a
+file from, while the "normal" URL will be used as target URL, the file that
+will be written/created.
+
+Note that not all FTP server allow 3rd party transfers. (Added in 7.13.0)
+.IP "--3p-user"
+(FTP) Specify user:password for the source URL transfer. (Added in 7.13.0)
.IP "-4/--ipv4"
If libcurl is capable of resolving an address to multiple IP versions (which
it is if it is ipv6-capable), this option tells libcurl to resolve names to
diff --git a/docs/examples/ftp3rdparty.c b/docs/examples/ftp3rdparty.c
index 31391ba96..b4756f580 100644
--- a/docs/examples/ftp3rdparty.c
+++ b/docs/examples/ftp3rdparty.c
@@ -1,8 +1,8 @@
/*****************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* $Id$
@@ -16,22 +16,20 @@
/*
* This is an example showing how to transfer a file between two remote hosts.
+ * 7.13.0 or later required.
*/
-
-
int main(void)
{
CURL *curl;
CURLcode res;
- char sourceFileName[] = "/tmp/file";
- char targetFileName[] = "/tmp/curlTargetTest.dat";
- char sourceHost[] = "source";
- char targetHost[] = "target";
+ char source_url[] = "ftp://remotehost.com/path/to/source";
+ char target_url[] = "ftp://aotherserver.com/path/to/dest";
+
char sourceUserPass[] = "user:pass";
char targetUserPass[] = "user:pass";
char url[100];
-
+
struct curl_slist *source_pre_cmd = NULL;
struct curl_slist *target_pre_cmd = NULL;
struct curl_slist *source_post_cmd = NULL;
@@ -39,24 +37,25 @@ int main(void)
char cmd[] = "PWD"; /* just to test */
curl_global_init(CURL_GLOBAL_DEFAULT);
-
+
curl = curl_easy_init();
if (curl) {
- sprintf(url, "ftp://%s@%s/%s", targetUserPass, targetHost, targetFileName);
- printf("%s\n", url);
- curl_easy_setopt(curl, CURLOPT_URL, url);
+ /* The ordinary URL is the target when speaking 3rd party transfers */
+ curl_easy_setopt(curl, CURLOPT_URL, target_url);
- /* Set a proxy host */
- curl_easy_setopt(curl, CURLOPT_SOURCE_HOST, sourceHost);
+ /* Set a source URL */
+ curl_easy_setopt(curl, CURLOPT_SOURCE_URL, source_url);
- /* Set a proxy user and password */
- curl_easy_setopt(curl, CURLOPT_SOURCE_USERPWD, sourceUserPass);
+ /* Set target user and password */
+ curl_easy_setopt(curl, CURLOPT_USERPWD, targetUserPass);
- /* Set a proxy full file name */
- curl_easy_setopt(curl, CURLOPT_SOURCE_PATH, sourceFileName);
+ /* Set source user and password */
+ curl_easy_setopt(curl, CURLOPT_SOURCE_USERPWD, sourceUserPass);
- /* Set a proxy passive host */
- curl_easy_setopt(curl, CURLOPT_PASV_HOST, 0); /* optional */
+#if 0
+ /* FTPPORT enables PORT on the target side, instead of PASV. */
+ curl_easy_setopt(curl, CURLOPT_FTPPORT, ""); /* optional */
+#endif
/* build a list of commands to pass to libcurl */
source_pre_cmd = curl_slist_append(source_pre_cmd, cmd);
@@ -77,7 +76,7 @@ int main(void)
target_post_cmd = curl_slist_append(target_post_cmd, cmd);
/* Set a post-quote command */
curl_easy_setopt(curl, CURLOPT_POSTQUOTE, target_post_cmd);
-
+
/* Switch on full protocol/debug output */
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
diff --git a/docs/libcurl/curl_easy_setopt.3 b/docs/libcurl/curl_easy_setopt.3
index 7beecfd1e..776e3da90 100644
--- a/docs/libcurl/curl_easy_setopt.3
+++ b/docs/libcurl/curl_easy_setopt.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@@ -21,7 +21,7 @@
.\" * $Id$
.\" **************************************************************************
.\"
-.TH curl_easy_setopt 3 "29 Nov 2004" "libcurl 7.12.3" "libcurl Manual"
+.TH curl_easy_setopt 3 "20 Jan 2005" "libcurl 7.12.4" "libcurl Manual"
.SH NAME
curl_easy_setopt - set options for a curl easy handle
.SH SYNOPSIS
@@ -751,6 +751,18 @@ Try "AUTH SSL" first, and only if that fails try "AUTH TLS"
.IP CURLFTPAUTH_TLS
Try "AUTH TLS" first, and only if that fails try "AUTH SSL"
.RE
+.IP CURLOPT_SOURCE_URL
+When set, it enables a FTP third party transfer, using the set URL as source,
+while \fICURLOPT_URL\fP is the target.
+.IP CURLOPT_SOURCE_USERPWD
+Set "username:password" to use for the source connection when doing FTP third
+party transfers.
+.IP CURLOPT_SOURCE_QUOTE
+Exactly like \fICURLOPT_QUOTE\fP, but for the source host.
+.IP CURLOPT_SOURCE_PREQUOTE
+Exactly like \fICURLOPT_PREQUOTE\fP, but for the source host.
+.IP CURLOPT_SOURCE_POSTQUOTE
+Exactly like \fICURLOPT_POSTQUOTE\fP, but for the source host.
.SH PROTOCOL OPTIONS
.IP CURLOPT_TRANSFERTEXT
A non-zero parameter tells the library to use ASCII mode for ftp transfers,