aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ftp.c2
-rw-r--r--lib/gtls.c3
-rw-r--r--lib/ssluse.c3
-rw-r--r--lib/url.c2
-rw-r--r--lib/urldata.h2
5 files changed, 9 insertions, 3 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index a23acd43e..8328315dc 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2566,7 +2566,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
/* we failed and bails out */
return CURLE_FTP_SSL_FAILED;
- if(data->set.ftp_use_ccc) {
+ if(data->set.ftp_ccc) {
/* CCC - Clear Command Channel
*/
NBFTPSENDF(conn, "CCC", NULL);
diff --git a/lib/gtls.c b/lib/gtls.c
index daf69aafe..f8c103450 100644
--- a/lib/gtls.c
+++ b/lib/gtls.c
@@ -533,6 +533,9 @@ int Curl_gtls_shutdown(struct connectdata *conn, int sockindex)
response. Thus we wait for a close notify alert from the server, but
we do not send one. Let's hope other servers do the same... */
+ if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE)
+ gnutls_bye(conn->ssl[sockindex].session, GNUTLS_SHUT_WR);
+
if(conn->ssl[sockindex].session) {
while(!done) {
int what = Curl_select(conn->sock[sockindex],
diff --git a/lib/ssluse.c b/lib/ssluse.c
index dc4fc927c..b362ab3f2 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -749,6 +749,9 @@ int Curl_ossl_shutdown(struct connectdata *conn, int sockindex)
response. Thus we wait for a close notify alert from the server, but
we do not send one. Let's hope other servers do the same... */
+ if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE)
+ (void)SSL_shutdown(connssl->handle);
+
if(connssl->handle) {
while(!done) {
int what = Curl_select(conn->sock[sockindex],
diff --git a/lib/url.c b/lib/url.c
index 3bd8dcb6d..05920b72e 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1156,7 +1156,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
break;
case CURLOPT_FTP_SSL_CCC:
- data->set.ftp_use_ccc = (bool)(0 != va_arg(param, long));
+ data->set.ftp_ccc = va_arg(param, long);
break;
case CURLOPT_FTP_SKIP_PASV_IP:
diff --git a/lib/urldata.h b/lib/urldata.h
index d50f9e44a..3325699d7 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -1283,10 +1283,10 @@ struct UserDefined {
bool reuse_fresh; /* do not re-use an existing connection */
bool ftp_use_epsv; /* if EPSV is to be attempted or not */
bool ftp_use_eprt; /* if EPRT is to be attempted or not */
- bool ftp_use_ccc; /* if CCC is to be attempted or not */
curl_ftpssl ftp_ssl; /* if AUTH TLS is to be attempted etc */
curl_ftpauth ftpsslauth; /* what AUTH XXX to be attempted */
+ curl_ftpccc ftp_ccc; /* FTP CCC options */
bool no_signal; /* do not use any signal/alarm handler */
bool global_dns_cache; /* subject for future removal */
bool tcp_nodelay; /* whether to enable TCP_NODELAY or not */