Support for FTP third party transfers is now dropped
authorDaniel Stenberg <daniel@haxx.se>
Sat, 30 Sep 2006 20:31:11 +0000 (20:31 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 30 Sep 2006 20:31:11 +0000 (20:31 +0000)
17 files changed:
CHANGES
RELEASE-NOTES
docs/curl.1
docs/libcurl/curl_easy_setopt.3
include/curl/curl.h
lib/Makefile.am
lib/ftp.c
lib/sendf.c
lib/transfer.c
lib/url.c
lib/urldata.h
src/main.c
tests/data/DISABLED
tests/data/Makefile.am
tests/data/test230 [deleted file]
tests/data/test231 [deleted file]
tests/data/test232 [deleted file]

diff --git a/CHANGES b/CHANGES
index a277a3e235ff07c957460299474fc7e17fd4bf16..c990c3cb4e577d229e18c61ace6d7a5571380673 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,27 @@
 
                                   Changelog
 
+Daniel (29 September 2006)
+- Removed a few other no-longer present options from the header file.
+
+- Support for FTP third party transfers was removed. Here's why:
+
+  o The recent multi interface changes broke it and the design of the 3rd party
+    transfers made it very hard to fix the problems
+  o It was still blocking and thus nasty for the multi interface
+  o It was a lot of extra code for a very rarely used feature
+  o It didn't use the same code as for "plain" FTP transfers, so it didn't work
+    fine for IPv6 and it didn't properly re-use connections and more
+  o There's nobody around who's willing to work on and improve the existing
+    code
+
+  This does not mean that third party transfers are banned forever, only that
+  they need to be done better if they are to be re-added in the future.
+
+  The CURLOPT_SOURCE_* options are removed from the lib and so are the --3p*
+  options from the command line tool. For this reason, I also bumped the
+  version info for the lib.
+
 Daniel (28 September 2006)
 - Reported in #1561470 (http://curl.haxx.se/bug/view.cgi?id=1561470), libcurl
   would crash if a bad function sequence was used when shutting down after
index 11330d30d6138d7201873aeb2b10be30be610e22..5c2f3f9af1cf77eae24e73b5bdb7870b137a74b3 100644 (file)
@@ -2,8 +2,8 @@ Curl and libcurl 7.16.0
 
  Public curl release number:               96
  Releases counted from the very beginning: 123
- Available command line options:           117
- Available curl_easy_setopt() options:     138
+ Available command line options:           112
+ Available curl_easy_setopt() options:     133
  Number of public functions in libcurl:    54
  Amount of public web site mirrors:        33
  Number of known libcurl bindings:         34
@@ -11,6 +11,8 @@ Curl and libcurl 7.16.0
 
 This release includes the following changes:
 
+ o The CURLOPT_SOURCE_* options are removed and so are the --3p* command line
+   options
  o curl_multi_socket() and family are suitable to start using
  o uses WSAPoll() on Windows Vista
  o (FTP) --ftp-ssl-control was added
index ef771fee7dd4f2a722627a3782816c811bf90c26..e71b7ea663432e0ef738540270f60faf509d37f5 100644 (file)
@@ -1242,17 +1242,6 @@ Forces curl to use SSL version 2 when negotiating with a remote SSL server.
 .IP "-3/--sslv3"
 (SSL)
 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
index ad0582746887b5b4a4061906d8cb63381bf290ea..141323cf67a8135d0207c55cd5a2a34927930eda 100644 (file)
@@ -917,18 +917,6 @@ 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.
 .IP CURLOPT_FTP_ACCOUNT
 Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP
 server asks for "account data" after user name and password has been provided,
index fbb9d32c19ec8de84ceb337ee7775e83108c633d..548c7f8484aa5208f97a5456345efb6108271511 100644 (file)
@@ -941,22 +941,12 @@ typedef enum {
   CINIT(TCP_NODELAY, LONG, 121),
 
   /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
-
-  /* When doing 3rd party transfer, set the source user and password with
-     this */
-  CINIT(SOURCE_USERPWD, OBJECTPOINT, 123),
-
+  /* 123 OBSOLETE. Gone in 7.16.0 */
   /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
   /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
   /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
-
-  /* When doing 3rd party transfer, set the source pre-quote linked list
-     of commands with this */
-  CINIT(SOURCE_PREQUOTE, OBJECTPOINT, 127),
-
-  /* When doing 3rd party transfer, set the source post-quote linked list
-     of commands with this */
-  CINIT(SOURCE_POSTQUOTE, OBJECTPOINT, 128),
+  /* 127 OBSOLETE. Gone in 7.16.0 */
+  /* 128 OBSOLETE. Gone in 7.16.0 */
 
   /* When FTP over SSL/TLS is selected (with CURLOPT_FTP_SSL), this option
      can be used to change libcurl's default action which is to first try
@@ -973,12 +963,8 @@ typedef enum {
   CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
   CINIT(IOCTLDATA, OBJECTPOINT, 131),
 
-  /* To make a 3rd party transfer, set the source URL with this */
-  CINIT(SOURCE_URL, OBJECTPOINT, 132),
-
-  /* When doing 3rd party transfer, set the source quote linked list of
-     commands with this */
-  CINIT(SOURCE_QUOTE, OBJECTPOINT, 133),
+  /* 132 OBSOLETE. Gone in 7.16.0 */
+  /* 133 OBSOLETE. Gone in 7.16.0 */
 
   /* zero terminated string for pass on to the FTP server when asked for
      "account" info */
@@ -1059,18 +1045,6 @@ typedef enum {
 
 #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
                           the obsolete stuff removed! */
-#define CURLOPT_HTTPREQUEST    -1
-#define CURLOPT_FTPASCII       CURLOPT_TRANSFERTEXT
-#define CURLOPT_MUTE           -2
-#define CURLOPT_PASSWDFUNCTION -3
-#define CURLOPT_PASSWDDATA     -4
-#define CURLOPT_CLOSEFUNCTION  -5
-
-#define CURLOPT_SOURCE_HOST    -6
-#define CURLOPT_SOURCE_PATH    -7
-#define CURLOPT_SOURCE_PORT    -8
-#define CURLOPT_PASV_HOST      -9
-
 #else
 /* This is set if CURL_NO_OLDIES is defined at compile-time */
 #undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
index 9958c8e6f9415dc7ba28e204adf487b324878b73..1a0f5fa637112b39c32e22d1ef4b17ec2171aedc 100644 (file)
@@ -48,7 +48,7 @@ INCLUDES = -I$(top_srcdir)/include \
            -I$(top_builddir)/lib   \
            -I$(top_srcdir)/lib
 
-VERSION=-version-info 3:0:0
+VERSION=-version-info 4:0:0
 
 # This flag accepts an argument of the form current[:revision[:age]]. So,
 # passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
index 48b66b363b0e77224e84b7ae92ce45743736db4e..924056f57e69fa296c24a18e357a4b7a3b3e0594 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -118,12 +118,9 @@ static CURLcode ftp_cwd(struct connectdata *conn, char *path);
 static CURLcode ftp_mkd(struct connectdata *conn, char *path);
 static CURLcode ftp_cwd_and_mkd(struct connectdata *conn, char *path);
 static CURLcode ftp_quit(struct connectdata *conn);
-static CURLcode ftp_3rdparty_pretransfer(struct connectdata *conn);
-static CURLcode ftp_3rdparty_transfer(struct connectdata *conn);
 static CURLcode ftp_parse_url_path(struct connectdata *conn);
 static CURLcode ftp_cwd_and_create_path(struct connectdata *conn);
 static CURLcode ftp_regular_transfer(struct connectdata *conn, bool *done);
-static CURLcode ftp_3rdparty(struct connectdata *conn);
 static void ftp_pasv_verbose(struct connectdata *conn,
                              Curl_addrinfo *ai,
                              char *newhost, /* ascii version */
@@ -2962,10 +2959,6 @@ CURLcode Curl_ftp_done(struct connectdata *conn, CURLcode status)
      */
     return CURLE_OK;
 
-
-  if (conn->sec_path)
-    path_to_use = conn->sec_path;
-
   /* now store a copy of the directory we are in */
   if(ftpc->prevpath)
     free(ftpc->prevpath);
@@ -3098,11 +3091,6 @@ CURLcode Curl_ftp_done(struct connectdata *conn, CURLcode status)
   ftp->no_transfer = FALSE;
   ftpc->dont_check = FALSE;
 
-  if (!result && conn->sec_conn) {   /* 3rd party transfer */
-    /* "done" with the secondary connection */
-    result = Curl_ftp_done(conn->sec_conn, status);
-  }
-
   /* Send any post-transfer QUOTE strings? */
   if(!status && !result && data->set.postquote)
     result = ftp_sendquote(conn, data->set.postquote);
@@ -3147,40 +3135,6 @@ CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote)
   return CURLE_OK;
 }
 
-/***********************************************************************
- *
- * ftp_transfertype()
- *
- * Set transfer type. We only deal with ASCII or BINARY so this function
- * sets one of them.
- */
-static CURLcode ftp_transfertype(struct connectdata *conn,
-                                  bool ascii)
-{
-  struct SessionHandle *data = conn->data;
-  int ftpcode;
-  ssize_t nread;
-  CURLcode result;
-
-  FTPSENDF(conn, "TYPE %c", ascii?'A':'I');
-
-  result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
-  if(result)
-    return result;
-
-  if(ftpcode != 200) {
-    failf(data, "Couldn't set %s mode",
-          ascii?"ASCII":"binary");
-    return ascii? CURLE_FTP_COULDNT_SET_ASCII:CURLE_FTP_COULDNT_SET_BINARY;
-  }
-
-  /* keep track of our current transfer type */
-  conn->proto.ftpc.transfertype = ascii?'A':'I';
-
-  return CURLE_OK;
-}
-
-
 /***********************************************************************
  *
  * ftp_need_type()
@@ -3428,13 +3382,7 @@ CURLcode Curl_ftp(struct connectdata *conn, bool *done)
   if (retcode)
     return retcode;
 
-  if (conn->sec_conn) {
-    /* 3rd party transfer */
-    *done = TRUE; /* BLOCKING */
-    retcode = ftp_3rdparty(conn);
-  }
-  else
-    retcode = ftp_regular_transfer(conn, done);
+  retcode = ftp_regular_transfer(conn, done);
 
   return retcode;
 }
@@ -3720,182 +3668,6 @@ static CURLcode ftp_cwd_and_mkd(struct connectdata *conn, char *path)
   return result;
 }
 
-
-
-/***********************************************************************
- *
- * ftp_3rdparty_pretransfer()
- *
- * Preparation for 3rd party transfer.
- *
- */
-static CURLcode ftp_3rdparty_pretransfer(struct connectdata *conn)
-{
-  CURLcode result = CURLE_OK;
-  struct SessionHandle *data = conn->data;
-  struct connectdata *sec_conn = conn->sec_conn;
-
-  conn->xfertype = TARGET3RD;
-  sec_conn->xfertype = SOURCE3RD;
-
-  /* sets transfer type */
-  result = ftp_transfertype(conn, data->set.prefer_ascii);
-  if (result)
-    return result;
-
-  result = ftp_transfertype(sec_conn, data->set.prefer_ascii);
-  if (result)
-    return result;
-
-  /* Send any PREQUOTE strings after transfer type is set? */
-  if (data->set.source_prequote) {
-    /* sends command(s) to source server before file transfer */
-    result = ftp_sendquote(sec_conn, data->set.source_prequote);
-  }
-  if (!result && data->set.prequote)
-    result = ftp_sendquote(conn, data->set.prequote);
-
-  return result;
-}
-
-
-
-/***********************************************************************
- *
- * ftp_3rdparty_transfer()
- *
- * Performs 3rd party transfer.
- *
- */
-static CURLcode ftp_3rdparty_transfer(struct connectdata *conn)
-{
-  CURLcode result = CURLE_OK;
-  ssize_t nread;
-  int ftpcode, ip[4], port[2];
-  struct SessionHandle *data = conn->data;
-  struct connectdata *sec_conn = conn->sec_conn;
-  char *buf = data->state.buffer;   /* this is our buffer */
-  char *str = buf;
-  char pasv_port[50];
-  const char *stor_cmd;
-  struct connectdata *pasv_conn;
-  struct connectdata *port_conn;
-
-  char *path = data->reqdata.path;
-
-  if (data->set.ftpport == NULL) {
-    pasv_conn = conn;
-    port_conn = sec_conn;
-  }
-  else {
-    pasv_conn = sec_conn;
-    port_conn = conn;
-  }
-
-  if (sec_conn->sec_path)
-    path = sec_conn->sec_path;
-
-  result = ftp_cwd_and_create_path(conn);
-  if (result)
-    return result;
-
-  /* sets the passive mode */
-  FTPSENDF(pasv_conn, "%s", "PASV");
-  result = Curl_GetFTPResponse(&nread, pasv_conn, &ftpcode);
-  if (result)
-    return result;
-
-  if (ftpcode != 227) {
-    failf(data, "Odd return code after PASV: %03d", ftpcode);
-    return CURLE_FTP_WEIRD_PASV_REPLY;
-  }
-
-  while (*str) {
-    if (6 == sscanf(str, "%d,%d,%d,%d,%d,%d",
-                    &ip[0], &ip[1], &ip[2], &ip[3], &port[0], &port[1]))
-      break;
-    str++;
-  }
-
-  if (!*str) {
-    failf(pasv_conn->data, "Couldn't interpret the 227-reply");
-    return CURLE_FTP_WEIRD_227_FORMAT;
-  }
-
-  snprintf(pasv_port, sizeof(pasv_port), "%d,%d,%d,%d,%d,%d", ip[0], ip[1],
-           ip[2], ip[3], port[0], port[1]);
-
-  /* sets data connection between remote hosts */
-  FTPSENDF(port_conn, "PORT %s", pasv_port);
-  result = Curl_GetFTPResponse(&nread, port_conn, &ftpcode);
-  if (result)
-    return result;
-
-  if (ftpcode != 200) {
-    failf(data, "PORT command attempts failed: %03d", ftpcode);
-    return CURLE_FTP_PORT_FAILED;
-  }
-
-  /* we might append onto the file instead of overwriting it */
-  stor_cmd = data->set.ftp_append?"APPE":"STOR";
-
-  /* transfers file between remote hosts */
-  /* FIX: this should send a series of CWD commands and then RETR only the
-     ftp->file file. The conn->data->reqdata.path "full path" is not
-     unescaped. Test case 230 tests this. */
-  FTPSENDF(sec_conn, "RETR %s", path);
-
-  if(!data->set.ftpport) {
-
-    result = Curl_GetFTPResponse(&nread, sec_conn, &ftpcode);
-    if (result)
-      return result;
-
-    if((ftpcode != 150) && (ftpcode != 125)) {
-      failf(data, "Failed RETR: %03d", ftpcode);
-      return CURLE_FTP_COULDNT_RETR_FILE;
-    }
-
-    result = Curl_ftpsendf(conn, "%s %s", stor_cmd,
-                           data->reqdata.proto.ftp->file);
-    if(CURLE_OK == result)
-      result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
-    if (result)
-      return result;
-
-    if (ftpcode >= 400) {
-      failf(data, "Failed FTP upload: %03d", ftpcode);
-      return CURLE_FTP_COULDNT_STOR_FILE;
-    }
-
-  }
-  else {
-
-    result = Curl_ftpsendf(conn, "%s %s", stor_cmd,
-                           data->reqdata.proto.ftp->file);
-    if(CURLE_OK == result)
-      result = Curl_GetFTPResponse(&nread, sec_conn, &ftpcode);
-    if (result)
-      return result;
-
-    if (ftpcode >= 400) {
-      failf(data, "Failed FTP upload: %03d", ftpcode);
-      return CURLE_FTP_COULDNT_STOR_FILE;
-    }
-
-    result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
-    if (result)
-      return result;
-
-    if((ftpcode != 150) && (ftpcode != 125)) {
-      failf(data, "Failed FTP upload: %03d", ftpcode);
-      return CURLE_FTP_COULDNT_STOR_FILE;
-    }
-  }
-
-  return CURLE_OK;
-}
-
 /***********************************************************************
  *
  * ftp_parse_url_path()
@@ -3916,10 +3688,6 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
   char *path_to_use = data->reqdata.path;
   char *cur_pos;
 
-  if (conn->sec_path) {
-    path_to_use = conn->sec_path;
-  }
-
   cur_pos = path_to_use; /* current position in path. point at the begin
                             of next path component */
 
@@ -4056,44 +3824,6 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
   return retcode;
 }
 
-
-
-/***********************************************************************
- *
- * ftp_cwd_and_create_path()
- *
- * Creates full path on remote target host.
- *
- */
-static
-CURLcode ftp_cwd_and_create_path(struct connectdata *conn)
-{
-  CURLcode result = CURLE_OK;
-  struct ftp_conn *ftpc = &conn->proto.ftpc;
-  int i;
-
-  if(ftpc->cwddone)
-    /* already done and fine */
-    return CURLE_OK;
-
-  /* This is a re-used connection. Since we change directory to where the
-     transfer is taking place, we must now get back to the original dir
-     where we ended up after login: */
-  if (conn->bits.reuse && ftpc->entrypath) {
-    if ((result = ftp_cwd_and_mkd(conn, ftpc->entrypath)) != CURLE_OK)
-      return result;
-  }
-
-  for (i=0; i < ftpc->dirdepth; i++) {
-    /* RFC 1738 says empty components should be respected too, but
-       that is plain stupid since CWD can't be used with an empty argument */
-    if ((result = ftp_cwd_and_mkd(conn, ftpc->dirs[i])) != CURLE_OK)
-      return result;
-  }
-
-  return result;
-}
-
 /* call this when the DO phase has completed */
 static CURLcode ftp_dophase_done(struct connectdata *conn,
                                  bool connected)
@@ -4188,30 +3918,4 @@ CURLcode ftp_regular_transfer(struct connectdata *conn,
   return result;
 }
 
-
-
-/***********************************************************************
- *
- * ftp_3rdparty()
- *
- * The input argument is already checked for validity.
- * Performs a 3rd party transfer between two remote hosts.
- */
-static CURLcode ftp_3rdparty(struct connectdata *conn)
-{
-  struct Curl_transfer_keeper *k = &conn->data->reqdata.keep;
-  CURLcode result = CURLE_OK;
-
-  /* both control connections start out fine */
-  conn->proto.ftpc.ctl_valid = TRUE;
-  conn->sec_conn->proto.ftpc.ctl_valid = TRUE;
-  k->size = -1;
-
-  result = ftp_3rdparty_pretransfer(conn);
-  if (!result)
-    result = ftp_3rdparty_transfer(conn);
-
-  return result;
-}
-
 #endif /* CURL_DISABLE_FTP */
index 7988d767dafeb50922b2043df52e5536a8eb2383..16fa9b0b29b9d73db1268496c9b5e4950d5239c6 100644 (file)
@@ -590,9 +590,7 @@ int Curl_debug(struct SessionHandle *data, curl_infotype type,
     }
 
     if(t) {
-      snprintf(buffer, sizeof(buffer), "[%s %s %s%s]", w, t,
-               conn->xfertype==NORMAL?"":
-               (conn->xfertype==SOURCE3RD?"source ":"target "),
+      snprintf(buffer, sizeof(buffer), "[%s %s %s]", w, t,
                conn->host.dispname);
       rc = showit(data, CURLINFO_TEXT, buffer, strlen(buffer));
       if(rc)
index 7436a9c6661c70b2c0b7c7b41bc3294315c592b3..ded1d5573c6b76448da365359bc75df57c7690c7 100644 (file)
@@ -2246,13 +2246,6 @@ CURLcode Curl_perform(struct SessionHandle *data)
   do {
     res = Curl_connect_host(data, &conn);   /* primary connection */
 
-    if(res == CURLE_OK) {
-      if (data->set.source_url) /* 3rd party transfer */
-        res = Curl_second_connect(conn);
-      else
-        conn->sec_conn = NULL;
-    }
-
     if(res == CURLE_OK) {
       bool do_done;
       if(data->set.connect_only) {
@@ -2263,8 +2256,7 @@ CURLcode Curl_perform(struct SessionHandle *data)
       }
       res = Curl_do(&conn, &do_done);
 
-      /* for non 3rd party transfer only */
-      if(res == CURLE_OK && !data->set.source_url) {
+      if(res == CURLE_OK) {
         res = Transfer(conn); /* now fetch that URL please */
         if(res == CURLE_OK) {
           retry = Curl_retry_request(conn, &newurl);
@@ -2382,57 +2374,3 @@ Curl_setup_transfer(
 
   return CURLE_OK;
 }
-
-/*
- * Curl_second_connect() makes the secondary connection (used for 3rd party
- * FTP transfers).
- */
-CURLcode Curl_second_connect(struct connectdata *conn)
-{
-  CURLcode status = CURLE_OK;
-  struct SessionHandle *data = conn->data;
-  struct connectdata *sec_conn = NULL;   /* secondary connection */
-  bool backup_reuse_fresh = data->set.reuse_fresh;
-  char *backup_userpwd = data->set.userpwd;
-  char *backup_path = data->reqdata.path;
-  char *backup_pathbuffer = data->reqdata.pathbuffer;
-
-  if(data->change.url_alloc)
-    free(data->change.url);
-
-  data->change.url_alloc = FALSE;
-  data->change.url = data->set.source_url;
-
-  /* We must never actually alter 'data->set' properties, so we restore the
-     backed up values afterwards! */
-
-#if 0
-  /* if both remote hosts are the same host - create new connection */
-  if (strequal(conn->host.dispname, data->set.source_host))
-#endif
-    data->set.reuse_fresh = TRUE;
-
-  data->set.userpwd = data->set.source_userpwd;
-
-  /* secondary connection */
-  status = Curl_connect_host(data, &sec_conn);
-  if(CURLE_OK == status) {
-    sec_conn->sec_conn = NULL;  /* important if re-using existing connection
-                                   to prevent loop */
-    sec_conn->data = data;
-    conn->sec_conn = sec_conn;
-  }
-
-  data->set.reuse_fresh = backup_reuse_fresh;
-  data->set.userpwd = backup_userpwd;
-
-  /* Copy the source path into a separate place */
-  sec_conn->sec_path = data->reqdata.path;
-  sec_conn->sec_pathbuffer = data->reqdata.pathbuffer;
-
-  /* Restore the original */
-  data->reqdata.path = backup_path;
-  data->reqdata.pathbuffer = backup_pathbuffer;
-
-  return status;
-}
index 9684210790f36c021c21ade8d625e0ec335f94ea..7bcb9822c2c5160a63a05522428e4b308241496f 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1618,42 +1618,13 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
     data->set.tcp_nodelay = (bool)(0 != va_arg(param, long));
     break;
 
-  /*********** 3rd party transfer options ***********/
-  case CURLOPT_SOURCE_URL:
     /*
-     * SOURCE URL
-     */
-    data->set.source_url = va_arg(param, char *);
-    data->set.printhost = (bool)(NULL != data->set.source_url);
-    break;
-
-  case CURLOPT_SOURCE_USERPWD:
-    /*
-     * Use SOURCE USER[:PASSWORD]
-     */
-    data->set.source_userpwd = va_arg(param, char *);
-    break;
-
-  case CURLOPT_SOURCE_QUOTE:
-    /*
-     * List of RAW FTP commands to use after a connect
-     */
-    data->set.source_quote = va_arg(param, struct curl_slist *);
-    break;
-
-  case CURLOPT_SOURCE_PREQUOTE:
-    /*
-     * List of RAW FTP commands to use before a transfer on the source host
-     */
-    data->set.source_prequote = va_arg(param, struct curl_slist *);
-    break;
-
-  case CURLOPT_SOURCE_POSTQUOTE:
-    /*
-     * List of RAW FTP commands to use after a transfer on the source host
-     */
-    data->set.source_postquote = va_arg(param, struct curl_slist *);
-    break;
+      case CURLOPT_SOURCE_URL:
+      case CURLOPT_SOURCE_USERPWD:
+      case CURLOPT_SOURCE_QUOTE:
+      case CURLOPT_SOURCE_PREQUOTE:
+      case CURLOPT_SOURCE_POSTQUOTE:
+      These former 3rd party transfer options are deprecated */
 
   case CURLOPT_FTP_ACCOUNT:
     data->set.ftp_account = va_arg(param, char *);
@@ -1726,7 +1697,6 @@ static void conn_free(struct connectdata *conn)
   Curl_safefree(conn->allocptr.cookiehost);
   Curl_safefree(conn->ip_addr_str);
   Curl_safefree(conn->trailer);
-  Curl_safefree(conn->sec_pathbuffer);
   Curl_safefree(conn->host.rawalloc); /* host name buffer */
   Curl_safefree(conn->proxy.rawalloc); /* proxy name buffer */
 
index 875dd0032ab76a48495697f2a3663e5029d81cda..f701fe96ceac7956b93cd4e3cb3c99f9bb2ed1da 100644 (file)
@@ -834,13 +834,6 @@ struct connectdata {
   struct Curl_async async;
 #endif
 
-  struct connectdata *sec_conn;   /* secondary connection for 3rd party
-                                     transfer */
-  char *sec_path;            /* The source path for FTP 3rd party */
-  char *sec_pathbuffer;
-
-  enum { NORMAL, SOURCE3RD, TARGET3RD } xfertype;
-
   /* These three are used for chunked-encoding trailer support */
   char *trailer; /* allocated buffer to store trailer in */
   int trlMax;    /* allocated buffer size */
index 273ad64ae08786c9e8a7920b63b880899b9b91c3..bb3839253401acd92232607fedbeb8cb83a84b60 100644 (file)
@@ -349,11 +349,6 @@ struct Configurable {
   long retry_delay; /* delay between retries (in seconds) */
   long retry_maxtime; /* maximum time to keep retrying */
 
-  char *tp_url; /* third party URL */
-  char *tp_user; /* third party userpwd */
-  struct curl_slist *tp_quote;
-  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;
@@ -596,9 +591,6 @@ static void help(void)
     " -1/--tlsv1         Use TLSv1 (SSL)",
     " -2/--sslv2         Use SSLv2 (SSL)",
     " -3/--sslv3         Use SSLv3 (SSL)",
-    "    --3p-quote      like -Q for the source URL for 3rd party transfer (F)",
-    "    --3p-url        source URL to activate 3rd party transfer (F)",
-    "    --3p-user       user and password for source 3rd party transfer (F)",
     " -4/--ipv4          Resolve name to IPv4 address",
     " -6/--ipv6          Resolve name to IPv6 address",
     " -#/--progress-bar  Display transfer progress as a progress bar",
@@ -1340,9 +1332,6 @@ 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},
     {"$n", "proxy-anyauth", FALSE},
     {"$o", "trace-time", FALSE},
@@ -1733,35 +1722,6 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
           return PARAM_BAD_NUMERIC;
         break;
 
-      case 'j': /* --3p-url */
-        GetStr(&config->tp_url, nextarg);
-        break;
-      case 'k': /* --3p-user */
-        GetStr(&config->tp_user, nextarg);
-        break;
-      case 'l': /* --3p-quote */
-        /* QUOTE commands to send to source FTP server */
-        err = PARAM_OK;
-        switch(nextarg[0]) {
-        case '-':
-          /* prefixed with a dash makes it a POST TRANSFER one */
-          nextarg++;
-          err = add2list(&config->tp_postquote, nextarg);
-          break;
-        case '+':
-          /* prefixed with a plus makes it a just-before-transfer one */
-          nextarg++;
-          err = add2list(&config->tp_prequote, nextarg);
-          break;
-        default:
-          err = add2list(&config->tp_quote, nextarg);
-          break;
-        }
-        if(err)
-          return err;
-
-        break;
-        /* break */
       case 'm': /* --ftp-account */
         GetStr(&config->ftp_account, nextarg);
         break;
@@ -3138,19 +3098,12 @@ static void free_config_fields(struct Configurable *config)
     free(config->capath);
   if(config->cookiejar)
     free(config->cookiejar);
-  if(config->tp_url)
-    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);
   curl_slist_free_all(config->postquote);
-  curl_slist_free_all(config->tp_quote);
-  curl_slist_free_all(config->tp_prequote);
-  curl_slist_free_all(config->tp_postquote);
   curl_slist_free_all(config->headers);
 }
 
@@ -4017,11 +3970,6 @@ operate(struct Configurable *config, int argc, char *argv[])
         }
 
         /* 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);
 
         curl_easy_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl);
index 2400ba005bdd33859bce114498e92d5f71b32769..ce6dc9556ea8ad35fe8267a8708103770149b232 100644 (file)
@@ -3,6 +3,5 @@
 # test cases are run by runtests.pl. Just add the plain test case numbers, one
 # per line.
 # Lines starting with '#' letters are treated as comments.
-230
-231
-232
+#230
+
index 067499c6fc17dea7e406a1052e43fec7610cec76..0d0df9af0aa7bcff1f49d7f5b6f22e7ad692d9c4 100644 (file)
@@ -28,8 +28,8 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46           \
  test194 test195 test196 test197 test198 test515 test516 test517 test518   \
  test210 test211 test212 test220 test221 test222 test223 test224 test206   \
  test207 test208 test209 test213 test240 test241 test242 test519 test214   \
- test215 test216 test217 test218 test199 test225 test226 test227 test230   \
- test231 test232 test228 test229 test233 test234 test235 test236 test520   \
+ test215 test216 test217 test218 test199 test225 test226 test227 \
+ test228 test229 test233 test234 test235 test236 test520   \
  test237 test238 test239 test243 test245 test246 test247 test248 test249   \
  test250 test251 test252 test253 test254 test255 test521 test522 test523   \
  test256 test257 test258 test259 test260 test261 test262 test263 test264   \
diff --git a/tests/data/test230 b/tests/data/test230
deleted file mode 100644 (file)
index b473f05..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<info>
-<keywords>
-FTP
-3rd party
-</keywords>
-</info>
-#
-# Server-side
-<reply>
-<data nocheck=1>
-contents of source file 230
-</data>
-</reply>
-
-#
-# Client-side
-<client>
-<server>
-ftp
-ftp2
-</server>
- <name>
-FTP 3rd party transfer
- </name>
- <command>
-ftp://%HOSTIP:%FTPPORT/dest/destpath/230 -u daniel:stenberg --3p-url ftp://%HOSTIP:%FTP2PORT/source/sourcepath/230 --3p-user daniel2:stenberg2
-</command>
-</client>
-
-#
-# Verify data after the test has been "shot"
-<verify>
-# target-side protocol check
-<protocol>
-USER daniel\r
-PASS stenberg\r
-PWD\r
-TYPE I\r
-CWD dest\r
-CWD destpath\r
-PASV\r
-STOR 230\r
-QUIT\r
-</protocol>
-<stripfile>
-s/^(PORT 127,0,0,1).*/$1/
-</stripfile>
-<file name="log/server2.input">
-USER daniel2\r
-PASS stenberg2\r
-PWD\r
-TYPE I\r
-PORT 127,0,0,1
-RETR source/sourcepath/230\r
-QUIT\r
-</file>
-</verify>
diff --git a/tests/data/test231 b/tests/data/test231
deleted file mode 100644 (file)
index 320982b..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<info>
-<keywords>
-FTP
-3rd party
-</keywords>
-</info>
-#
-# Server-side
-<reply>
-<data nocheck=1>
-contents of source file 231
-</data>
-</reply>
-
-#
-# Client-side
-<client>
-<server>
-ftp
-ftp2
-</server>
- <name>
-FTP 3rd party transfer, make target use PORT
- </name>
- <command>
-ftp://%HOSTIP:%FTPPORT/dest/destpath/231 -u daniel:stenberg --3p-url ftp://%HOSTIP:%FTP2PORT/source/sourcepath/231 --3p-user daniel2:stenberg2 -P -
-</command>
-</client>
-
-#
-# Verify data after the test has been "shot"
-<verify>
-# target-side protocol check
-<strippart>>
-s/^(PORT 127,0,0,1).*/$1/
-</strippart>
-<protocol>
-USER daniel\r
-PASS stenberg\r
-PWD\r
-TYPE I\r
-CWD dest\r
-CWD destpath\r
-PORT 127,0,0,1
-STOR 231\r
-QUIT\r
-</protocol>
-<file name="log/server2.input">
-USER daniel2\r
-PASS stenberg2\r
-PWD\r
-TYPE I\r
-PASV\r
-RETR source/sourcepath/231\r
-QUIT\r
-</file>
-</verify>
diff --git a/tests/data/test232 b/tests/data/test232
deleted file mode 100644 (file)
index b87831a..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<info>
-<keywords>
-FTP
-3rd party
-</keywords>
-</info>
-#
-# Server-side
-<reply>
-<data nocheck=1>
-contents of source file 232
-</data>
-</reply>
-
-#
-# Client-side
-<client>
-<server>
-ftp
-ftp2
-</server>
- <name>
-FTP 3rd party transfer, anonymous user
- </name>
- <command>
-ftp://%HOSTIP:%FTPPORT/dest/destpath/232 --3p-url ftp://%HOSTIP:%FTP2PORT/source/sourcepath/232
-</command>
-</client>
-
-#
-# Verify data after the test has been "shot"
-<verify>
-# target-side protocol check
-<protocol>
-USER anonymous\r
-PASS curl_by_daniel@haxx.se\r
-PWD\r
-TYPE I\r
-CWD dest\r
-CWD destpath\r
-PASV\r
-STOR 232\r
-QUIT\r
-</protocol>
-<stripfile>
-s/^(PORT 127,0,0,1).*/$1/
-</stripfile>
-<file name="log/server2.input">
-USER anonymous\r
-PASS curl_by_daniel@haxx.se\r
-PWD\r
-TYPE I\r
-PORT 127,0,0,1
-RETR source/sourcepath/232\r
-QUIT\r
-</file>
-</verify>