]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ftp: shut down the secondary connection properly when SSL is used
authorDaniel Stenberg <daniel@haxx.se>
Wed, 13 May 2020 10:22:49 +0000 (12:22 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 15 May 2020 06:28:55 +0000 (08:28 +0200)
Reported-by: Neal Poole
Fixes #5340
Closes #5385

lib/ftp.c

index 3b0f03b81c0a32bc314ca217dd4ac7c4e2779254..289dab259070825898b1bb6fcdf0790c0e1551d7 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -221,6 +221,7 @@ static void close_secondarysocket(struct connectdata *conn)
     conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD;
   }
   conn->bits.tcpconnect[SECONDARYSOCKET] = FALSE;
+  conn->bits.proxy_ssl_connected[SECONDARYSOCKET] = FALSE;
 }
 
 /*
@@ -3231,9 +3232,9 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
     }
 
     if(conn->ssl[SECONDARYSOCKET].use) {
-      /* The secondary socket is using SSL so we must close down that part
-         first before we close the socket for real */
-      Curl_ssl_close(conn, SECONDARYSOCKET);
+      /* The secondary socket used SSL so we must close down that part first
+         before we close the socket for real */
+      result = Curl_ssl_shutdown(conn, SECONDARYSOCKET);
 
       /* Note that we keep "use" set to TRUE since that (next) connection is
          still requested to use SSL */