]> granicus.if.org Git - curl/commitdiff
Correct error code for CCC/SSL shutdown failure
authorLinus Nielsen Feltzing <linus@haxx.se>
Mon, 8 Jan 2007 11:24:11 +0000 (11:24 +0000)
committerLinus Nielsen Feltzing <linus@haxx.se>
Mon, 8 Jan 2007 11:24:11 +0000 (11:24 +0000)
include/curl/curl.h
lib/ftp.c
lib/sslgen.c
lib/strerror.c

index 8bbdd1b244e38c92ed4c12d03519f3fb89ae83bb..f41067614e651690e135a4016cadb240906a028a 100644 (file)
@@ -397,8 +397,8 @@ typedef enum {
                                     generic so the error message will be of
                                     interest when this has happened */
 
-  CURLE_FTP_SSL_CCC_FAILED,      /* 80 - Failed to clear the FTP command
-                                    channel */
+  CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL
+                                    connection */
   CURL_LAST /* never use! */
 } CURLcode;
 
index 56b6cf229f6d3b12e54cdc823e44e45d7915bab7..4b6139edf841f7bd556dfe2642974fa9dbc48279 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2563,8 +2563,10 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
       /* First shut down the SSL layer (note: this call will block) */
       result = Curl_ssl_shutdown(conn, FIRSTSOCKET);
 
-      if(result)
-        return CURLE_FTP_SSL_CCC_FAILED;
+      if(result) {
+        failf(conn->data, "Failed to clear the command channel (CCC)");
+        return result;
+      }
 
       /* Then continue as normal */
       result = ftp_state_pwd(conn);
index cc9642b66ed31d04c1d3e3f76750cbd1e6f57430..33f038017fafa8a98804f6004c5ce7aa8421a8d8 100644 (file)
@@ -401,10 +401,12 @@ CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex)
 {
   if(conn->ssl[sockindex].use) {
 #ifdef USE_SSLEAY
-    return Curl_ossl_shutdown(conn, sockindex);
+    if(Curl_ossl_shutdown(conn, sockindex))
+      return CURLE_SSL_SHUTDOWN_FAILED;
 #else
 #ifdef USE_GNUTLS
-    return Curl_gtls_shutdown(conn, sockindex);
+    if(Curl_gtls_shutdown(conn, sockindex))
+      return CURLE_SSL_SHUTDOWN_FAILED;
 #else
     (void)conn;
     (void)sockindex;
index 2634dffdb5055ee49de593e33a7360c5445a3166..6304fe89d35ea416219e3d9f24c0300808f9c287 100644 (file)
@@ -244,8 +244,8 @@ curl_easy_strerror(CURLcode error)
   case CURLE_FTP_SSL_FAILED:
     return "Requested FTP SSL level failed";
 
-  case CURLE_FTP_SSL_CCC_FAILED:
-    return "Failed to clear the FTP command channel";
+  case CURLE_SSL_SHUTDOWN_FAILED:
+    return "Failed to shut down the SSL connection";
 
   case CURLE_SEND_FAIL_REWIND:
     return "Send failed since rewinding of the data stream failed";