]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Only shut down SSL if the CCC command succeeded.
authorDan Fandrich <dan@coneharvesters.com>
Wed, 24 Jan 2007 19:09:12 +0000 (19:09 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Wed, 24 Jan 2007 19:09:12 +0000 (19:09 +0000)
lib/ftp.c

index 900def4bba84f33cf323195fbea230298187e163..2ae973790ac9b471f9952e47a3e55e51c58a5744 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2560,12 +2560,14 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
       break;
 
     case FTP_CCC:
-      /* First shut down the SSL layer (note: this call will block) */
-      result = Curl_ssl_shutdown(conn, FIRSTSOCKET);
-
-      if(result) {
-        failf(conn->data, "Failed to clear the command channel (CCC)");
-        return result;
+      if (ftpcode < 500) {
+       /* First shut down the SSL layer (note: this call will block) */
+       result = Curl_ssl_shutdown(conn, FIRSTSOCKET);
+
+       if(result) {
+         failf(conn->data, "Failed to clear the command channel (CCC)");
+         return result;
+       }
       }
 
       /* Then continue as normal */