aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-12-09 15:02:37 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-12-09 15:02:37 +0000
commit4b62cd36169505571038c99bfcf6d9ee65812872 (patch)
tree1d976ab0c1e169cfa73859930636b39cae311ba4 /lib/ftp.c
parentdf7b1d8e64b4675880a34ac713894b2161a2e84c (diff)
- Ken Hirsch simplified how libcurl does FTPS: now it doesn't assume any
particular state for the control connection like it did before for implicit FTPS (libcurl assumed such control connections to be encrypted while some FTPS servers such as FileZilla assumes such connections to be clear mode). Use the CURLOPT_USE_SSL option to set your desired level.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 209faf7d7..7f17cc111 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -150,9 +150,6 @@ static int ftp_getsock(struct connectdata *conn,
static CURLcode ftp_doing(struct connectdata *conn,
bool *dophase_done);
static CURLcode ftp_setup_connection(struct connectdata * conn);
-#ifdef USE_SSL
-static CURLcode ftps_setup_connection(struct connectdata * conn);
-#endif
/* easy-to-use macro: */
#define FTPSENDF(x,y,z) if((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \
@@ -189,7 +186,7 @@ const struct Curl_handler Curl_handler_ftp = {
const struct Curl_handler Curl_handler_ftps = {
"FTPS", /* scheme */
- ftps_setup_connection, /* setup_connection */
+ ftp_setup_connection, /* setup_connection */
ftp_do, /* do_it */
ftp_done, /* done */
ftp_nextconnect, /* do_more */
@@ -2683,24 +2680,9 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
break;
case FTP_PBSZ:
- /* FIX: check response code */
-
- /* For TLS, the data connection can have one of two security levels.
-
- 1) Clear (requested by 'PROT C')
-
- 2)Private (requested by 'PROT P')
- */
- if(!conn->ssl[SECONDARYSOCKET].use) {
- NBFTPSENDF(conn, "PROT %c",
- data->set.ftp_ssl == CURLUSESSL_CONTROL ? 'C' : 'P');
- state(conn, FTP_PROT);
- }
- else {
- result = ftp_state_pwd(conn);
- if(result)
- return result;
- }
+ NBFTPSENDF(conn, "PROT %c",
+ data->set.ftp_ssl == CURLUSESSL_CONTROL ? 'C' : 'P');
+ state(conn, FTP_PROT);
break;
@@ -4179,14 +4161,4 @@ static CURLcode ftp_setup_connection(struct connectdata * conn)
return CURLE_OK;
}
-#ifdef USE_SSL
-static CURLcode ftps_setup_connection(struct connectdata * conn)
-{
- struct SessionHandle *data = conn->data;
-
- conn->ssl[SECONDARYSOCKET].use = data->set.ftp_ssl != CURLUSESSL_CONTROL;
- return ftp_setup_connection(conn);
-}
-#endif
-
#endif /* CURL_DISABLE_FTP */