mirror of
https://github.com/curl/curl.git
synced 2026-08-26 06:53:32 +03:00
New FTP CCC functionality - adds passive and active mode to accomodate for different server behaviour
This commit is contained in:
parent
6014c21bc9
commit
2f5e99ca02
9 changed files with 61 additions and 11 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue