summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-05-13 12:22:49 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-15 08:28:55 +0200
commitf002c850d98dc2dbed34d6547a38a6c0b4c89e10 (patch)
tree83ae30f13b233a4a344fd5bd71dbdbe0a36d5968
parentaa6cf7f3b6bc7e638487cf72f24922bac25c0cbd (diff)
downloadcurl-f002c850d98dc2dbed34d6547a38a6c0b4c89e10.tar.gz
ftp: shut down the secondary connection properly when SSL is used
Reported-by: Neal Poole Fixes #5340 Closes #5385
-rw-r--r--lib/ftp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 3b0f03b81..289dab259 100644
--- 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 */