]> granicus.if.org Git - curl/commitdiff
Renamed the CURLE_FTP_SSL_FAILED error code to CURLE_USE_SSL_FAILED.
authorDan Fandrich <dan@coneharvesters.com>
Fri, 31 Aug 2007 19:36:32 +0000 (19:36 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Fri, 31 Aug 2007 19:36:32 +0000 (19:36 +0000)
Renamed the curl_ftpssl enum to curl_usessl and its enumerated constants,
creating macros for backward compatibility.

CHANGES
docs/libcurl/curl_easy_setopt.3
docs/libcurl/libcurl-errors.3
include/curl/curl.h
lib/ftp.c
lib/strerror.c
lib/url.c
lib/urldata.h
packages/OS400/curl.inc.in
src/main.c

diff --git a/CHANGES b/CHANGES
index e4717a6bd8e5899101daf044de82f89dc5f852e5..879d538d23ea36241f7744a398c5a79e83df8074 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,15 @@ Dan F (31 August 2007)
 - Made some of the error strings returned by the *strerror functions more
   generic, and more consistent with each other.
 
+- Renamed the curl_ftpssl enum to curl_usessl and its enumerated constants,
+  creating macros for backward compatibility:
+
+    CURLFTPSSL_NONE => CURLUSESSL_NONE
+    CURLFTPSSL_TRY => CURLUSESSL_TRY
+    CURLFTPSSL_CONTROL => CURLUSESSL_CONTROL
+    CURLFTPSSL_ALL => CURLUSESSL_ALL
+    CURLFTPSSL_LAST => CURLUSESSL_LAST
+
 Dan F (30 August 2007)
 - Renamed several libcurl error codes and options to make them more general
   and allow reuse by multiple protocols. Several unused error codes were
@@ -39,6 +48,7 @@ Dan F (30 August 2007)
 
     CURLE_FTP_ACCESS_DENIED =>      CURLE_REMOTE_ACCESS_DENIED
     CURLE_FTP_COULDNT_SET_BINARY => CURLE_FTP_COULDNT_SET_TYPE
+    CURLE_FTP_SSL_FAILED =>         CURLE_USE_SSL_FAILED
     CURLE_FTP_QUOTE_ERROR =>        CURLE_QUOTE_ERROR
     CURLE_TFTP_DISKFULL =>          CURLE_REMOTE_DISK_FULL
     CURLE_TFTP_EXISTS =>            CURLE_REMOTE_FILE_EXISTS
index f3da0014acf9865ed824fed8379367cd615a21f9..0e5d6afff95e9b3856208d0265a99fdd3d053163 100644 (file)
@@ -940,16 +940,17 @@ This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
 Pass a long using one of the values from below, to make libcurl use your
 desired level of SSL for the ftp transfer. (Added in 7.11.0)
 
-(This option was known as CURLOPT_FTP_SSL up to 7.16.4)
+(This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants
+were known as CURLFTPSSL_*)
 .RS
-.IP CURLFTPSSL_NONE
+.IP CURLUSESSL_NONE
 Don't attempt to use SSL.
-.IP CURLFTPSSL_TRY
+.IP CURLUSESSL_TRY
 Try using SSL, proceed as normal otherwise.
-.IP CURLFTPSSL_CONTROL
-Require SSL for the control connection or fail with \fICURLE_FTP_SSL_FAILED\fP.
-.IP CURLFTPSSL_ALL
-Require SSL for all communication or fail with \fICURLE_FTP_SSL_FAILED\fP.
+.IP CURLUSESSL_CONTROL
+Require SSL for the control connection or fail with \fICURLE_USE_SSL_FAILED\fP.
+.IP CURLUSESSL_ALL
+Require SSL for all communication or fail with \fICURLE_USE_SSL_FAILED\fP.
 .RE
 .IP CURLOPT_FTPSSLAUTH
 Pass a long using one of the values from below, to alter how libcurl issues
index 6aaf11db7c4ad52a97e3e3963b0f78f89de050de..1d8f4e88b08ca5f6589db9f87f95e400ffa71c92 100644 (file)
@@ -173,7 +173,7 @@ Unrecognized transfer encoding
 Invalid LDAP URL
 .IP "CURLE_FILESIZE_EXCEEDED (63)"
 Maximum file size exceeded
-.IP "CURLE_FTP_SSL_FAILED (64)"
+.IP "CURLE_USE_SSL_FAILED (64)"
 Requested FTP SSL level failed
 .IP "CURLE_SEND_FAIL_REWIND (65)"
 When doing a send operation curl had to rewind the data to retransmit, but the
index 6bd37c73fa7ee95ba6d525d95a532788f46c0828..e7f5ec59c3c1e5f06a1ca2cbd3637c5114fb7330 100644 (file)
@@ -381,7 +381,7 @@ typedef enum {
   CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized transfer encoding */
   CURLE_LDAP_INVALID_URL,        /* 62 - Invalid LDAP URL */
   CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */
-  CURLE_FTP_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */
+  CURLE_USE_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */
   CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind
                                     that failed */
   CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */
@@ -439,6 +439,7 @@ typedef enum {
 #define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL
 #define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS
 #define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR 
+#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED
 
 /* The following were added earlier */
 
@@ -492,12 +493,26 @@ typedef enum {
 
 /* parameter for the CURLOPT_USE_SSL option */
 typedef enum {
-  CURLFTPSSL_NONE,    /* do not attempt to use SSL */
-  CURLFTPSSL_TRY,     /* try using SSL, proceed anyway otherwise */
-  CURLFTPSSL_CONTROL, /* SSL for the control connection or fail */
-  CURLFTPSSL_ALL,     /* SSL for all communication or fail */
-  CURLFTPSSL_LAST     /* not an option, never use */
-} curl_ftpssl;
+  CURLUSESSL_NONE,    /* do not attempt to use SSL */
+  CURLUSESSL_TRY,     /* try using SSL, proceed anyway otherwise */
+  CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
+  CURLUSESSL_ALL,     /* SSL for all communication or fail */
+  CURLUSESSL_LAST     /* not an option, never use */
+} curl_usessl;
+
+#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
+                          the obsolete stuff removed! */
+
+/* Backwards compatibility with older names */
+/* These are scheduled to disappear by 2009 */
+
+#define CURLFTPSSL_NONE CURLUSESSL_NONE
+#define CURLFTPSSL_TRY CURLUSESSL_TRY
+#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
+#define CURLFTPSSL_ALL CURLUSESSL_ALL
+#define CURLFTPSSL_LAST CURLUSESSL_LAST
+#define curl_ftpssl curl_usessl
+#endif /*!CURL_NO_OLDIES*/
 
 /* parameter for the CURLOPT_FTP_SSL_CCC option */
 typedef enum {
index 74c8e0db32c5b9852e3630a5928d58058ef78369..36fe4686bcfeeb9bd027f0f8a51e866d378587c7 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2465,9 +2465,9 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
         /* remain in this same state */
       }
       else {
-        if(data->set.ftp_ssl > CURLFTPSSL_TRY)
-          /* we failed and CURLFTPSSL_CONTROL or CURLFTPSSL_ALL is set */
-          result = CURLE_FTP_SSL_FAILED;
+        if(data->set.ftp_ssl > CURLUSESSL_TRY)
+          /* we failed and CURLUSESSL_CONTROL or CURLUSESSL_ALL is set */
+          result = CURLE_USE_SSL_FAILED;
         else
           /* ignore the failure and continue */
           result = ftp_state_user(conn);
@@ -2497,7 +2497,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
       */
       if(!conn->ssl[SECONDARYSOCKET].use) {
         NBFTPSENDF(conn, "PROT %c",
-                   data->set.ftp_ssl == CURLFTPSSL_CONTROL ? 'C' : 'P');
+                   data->set.ftp_ssl == CURLUSESSL_CONTROL ? 'C' : 'P');
         state(conn, FTP_PROT);
       }
       else {
@@ -2512,12 +2512,12 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
       if(ftpcode/100 == 2)
         /* We have enabled SSL for the data connection! */
         conn->ssl[SECONDARYSOCKET].use =
-          (bool)(data->set.ftp_ssl != CURLFTPSSL_CONTROL);
+          (bool)(data->set.ftp_ssl != CURLUSESSL_CONTROL);
       /* FTP servers typically responds with 500 if they decide to reject
          our 'P' request */
-      else if(data->set.ftp_ssl> CURLFTPSSL_CONTROL)
+      else if(data->set.ftp_ssl > CURLUSESSL_CONTROL)
         /* we failed and bails out */
-        return CURLE_FTP_SSL_FAILED;
+        return CURLE_USE_SSL_FAILED;
 
       if(data->set.ftp_ccc) {
         /* CCC - Clear Command Channel
index 9193fd0ca2f16cb359f4b37ac21644d49c0f3e62..658a8cba1f25cc51a5e6f59ca3f22dc02f06b476 100644 (file)
@@ -216,8 +216,8 @@ curl_easy_strerror(CURLcode error)
   case CURLE_FILESIZE_EXCEEDED:
     return "Maximum file size exceeded";
 
-  case CURLE_FTP_SSL_FAILED:
-    return "Requested FTP SSL level failed";
+  case CURLE_USE_SSL_FAILED:
+    return "Requested SSL level failed";
 
   case CURLE_SSL_SHUTDOWN_FAILED:
     return "Failed to shut down the SSL connection";
index 09febb075ec6f095a421bb4e539532c206ddce24..9a7b22a94b64bd2d192ec4a23f2845f36fe09747 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1734,7 +1734,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
     /*
      * Make transfers attempt to use SSL/TLS.
      */
-    data->set.ftp_ssl = (curl_ftpssl)va_arg(param, long);
+    data->set.ftp_ssl = (curl_usessl)va_arg(param, long);
     break;
 
   case CURLOPT_FTPSSLAUTH:
@@ -2948,7 +2948,7 @@ static CURLcode setup_connection_internals(struct SessionHandle *data,
 #ifdef USE_SSL
       conn->protocol |= PROT_FTPS|PROT_SSL;
       /* send data securely unless specifically requested otherwise */
-      conn->ssl[SECONDARYSOCKET].use = data->set.ftp_ssl != CURLFTPSSL_CONTROL;
+      conn->ssl[SECONDARYSOCKET].use = data->set.ftp_ssl != CURLUSESSL_CONTROL;
       port = PORT_FTPS;
 #else
       failf(data, LIBCURL_NAME
index e760e0c39a33c8e2938bc2c0f0e13113db81058e..381849a38d61c88c0aed6e7dde294cd64c4a33dd 100644 (file)
@@ -1404,7 +1404,7 @@ struct UserDefined {
   bool ftp_use_epsv;     /* if EPSV is to be attempted or not */
   bool ftp_use_eprt;     /* if EPRT is to be attempted or not */
 
-  curl_ftpssl ftp_ssl;   /* if AUTH TLS is to be attempted etc */
+  curl_usessl ftp_ssl;   /* if AUTH TLS is to be attempted etc */
   curl_ftpauth ftpsslauth; /* what AUTH XXX to be attempted */
   curl_ftpccc ftp_ccc;   /* FTP CCC options */
   bool no_signal;        /* do not use any signal/alarm handler */
index f57d6f71253c9f19867e113c029ac97a77137fc4..01b7c3759433695f64943cf36049788641979f61 100644 (file)
      d                 c                   62
      d  CURLE_FILESIZE_EXCEEDED...
      d                 c                   63
-     d  CURLE_FTP_SSL_FAILED...
+     d  CURLE_USE_SSL_FAILED...
      d                 c                   64
      d  CURLE_SEND_FAIL_REWIND...
      d                 c                   65
      d  CURLPROXY_SOCKS5...
      d                 c                   5
       *
-     d curl_ftpssl     s             10i 0 based(######ptr######)               Enum
-     d  CURLFTPSSL_NONE...
+     d curl_usessl     s             10i 0 based(######ptr######)               Enum
+     d  CURLUSESSL_NONE...
      d                 c                   0
-     d  CURLFTPSSL_TRY...
+     d  CURLUSESSL_TRY...
      d                 c                   1
-     d  CURLFTPSSL_CONTROL...
+     d  CURLUSESSL_CONTROL...
      d                 c                   2
-     d  CURLFTPSSL_ALL...
+     d  CURLUSESSL_ALL...
      d                 c                   3
       *
      d curl_ftpccc     s             10i 0 based(######ptr######)               Enum
index 1a9f6e3c21d77eb8367a83fe9f366cd779e9bdc9..3eca434e05aafb4713911033d1fc681860e9c7fd 100644 (file)
@@ -4323,15 +4323,15 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
 
         /* new in curl 7.15.5 */
         if(config->ftp_ssl_reqd)
-          my_setopt(curl, CURLOPT_USE_SSL, CURLFTPSSL_ALL);
+          my_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);
 
         /* new in curl 7.11.0 */
         else if(config->ftp_ssl)
-          my_setopt(curl, CURLOPT_USE_SSL, CURLFTPSSL_TRY);
+          my_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);
 
         /* new in curl 7.16.0 */
         else if(config->ftp_ssl_control)
-          my_setopt(curl, CURLOPT_USE_SSL, CURLFTPSSL_CONTROL);
+          my_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_CONTROL);
 
         /* new in curl 7.16.1 */
         if(config->ftp_ssl_ccc)