ftp: shut down the secondary connection properly when SSL is used

Reported-by: Neal Poole
Fixes #5340
Closes #5385
This commit is contained in:
Daniel Stenberg 2020-05-13 12:22:49 +02:00
Родитель aa6cf7f3b6
Коммит f002c850d9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5CC908FDB71E12C2
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -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 */