char *newhost, /* ascii version */
int port);
#endif
-static CURLcode ftp_state_post_rest(struct connectdata *conn);
-static CURLcode ftp_state_post_cwd(struct connectdata *conn);
+static CURLcode ftp_state_prepare_transfer(struct connectdata *conn);
+static CURLcode ftp_state_mdtm(struct connectdata *conn);
static CURLcode ftp_state_quote(struct connectdata *conn,
bool init, ftpstate instate);
static CURLcode ftp_nb_type(struct connectdata *conn,
static void wc_data_dtor(void *ptr);
-static CURLcode ftp_state_post_retr_size(struct connectdata *conn,
- curl_off_t filesize);
+static CURLcode ftp_state_retr(struct connectdata *conn, curl_off_t filesize);
static CURLcode ftp_readresp(curl_socket_t sockfd,
struct pingpong *pp,
if(ftpc->cwddone)
/* already done and fine */
- result = ftp_state_post_cwd(conn);
+ result = ftp_state_mdtm(conn);
else {
ftpc->count2 = 0; /* count2 counts failed CWDs */
}
else {
/* No CWD necessary */
- result = ftp_state_post_cwd(conn);
+ result = ftp_state_mdtm(conn);
}
}
}
return result;
}
-/* REST is the last command in the chain of commands when a "head"-like
- request is made. Thus, if an actual transfer is to be made this is where
- we take off for real. */
-static CURLcode ftp_state_post_rest(struct connectdata *conn)
+/*
+ * ftp_state_prepare_transfer() starts PORT, PASV or PRET etc.
+ *
+ * REST is the last command in the chain of commands when a "head"-like
+ * request is made. Thus, if an actual transfer is to be made this is where we
+ * take off for real.
+ */
+static CURLcode ftp_state_prepare_transfer(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct FTP *ftp = conn->data->state.proto.ftp;
return result;
}
-static CURLcode ftp_state_post_size(struct connectdata *conn)
+static CURLcode ftp_state_rest(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct FTP *ftp = conn->data->state.proto.ftp;
state(conn, FTP_REST);
}
else
- result = ftp_state_post_rest(conn);
+ result = ftp_state_prepare_transfer(conn);
return result;
}
-static CURLcode ftp_state_post_type(struct connectdata *conn)
+static CURLcode ftp_state_size(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct FTP *ftp = conn->data->state.proto.ftp;
state(conn, FTP_SIZE);
}
else
- result = ftp_state_post_size(conn);
+ result = ftp_state_rest(conn);
return result;
}
-static CURLcode ftp_state_post_listtype(struct connectdata *conn)
+static CURLcode ftp_state_list(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
return result;
}
-static CURLcode ftp_state_post_retrtype(struct connectdata *conn)
+static CURLcode ftp_state_retr_prequote(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
return result;
}
-static CURLcode ftp_state_post_stortype(struct connectdata *conn)
+static CURLcode ftp_state_stor_prequote(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
return result;
}
-static CURLcode ftp_state_post_mdtm(struct connectdata *conn)
+static CURLcode ftp_state_type(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct FTP *ftp = conn->data->state.proto.ftp;
return result;
}
else
- result = ftp_state_post_type(conn);
+ result = ftp_state_size(conn);
return result;
}
/* This is called after the CWD commands have been done in the beginning of
the DO phase */
-static CURLcode ftp_state_post_cwd(struct connectdata *conn)
+static CURLcode ftp_state_mdtm(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
state(conn, FTP_MDTM);
}
else
- result = ftp_state_post_mdtm(conn);
+ result = ftp_state_type(conn);
return result;
}
else {
if(ftpc->known_filesize != -1) {
Curl_pgrsSetDownloadSize(data, ftpc->known_filesize);
- result = ftp_state_post_retr_size(conn, ftpc->known_filesize);
+ result = ftp_state_retr(conn, ftpc->known_filesize);
}
else {
PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file);
}
if(!result)
- result = ftp_state_post_mdtm(conn);
+ result = ftp_state_type(conn);
return result;
}
ftpcode);
if(instate == FTP_TYPE)
- result = ftp_state_post_type(conn);
+ result = ftp_state_size(conn);
else if(instate == FTP_LIST_TYPE)
- result = ftp_state_post_listtype(conn);
+ result = ftp_state_list(conn);
else if(instate == FTP_RETR_TYPE)
- result = ftp_state_post_retrtype(conn);
+ result = ftp_state_retr_prequote(conn);
else if(instate == FTP_STOR_TYPE)
- result = ftp_state_post_stortype(conn);
+ result = ftp_state_stor_prequote(conn);
return result;
}
-static CURLcode ftp_state_post_retr_size(struct connectdata *conn,
+static CURLcode ftp_state_retr(struct connectdata *conn,
curl_off_t filesize)
{
CURLcode result = CURLE_OK;
}
#endif
Curl_pgrsSetDownloadSize(data, filesize);
- result = ftp_state_post_size(conn);
+ result = ftp_state_rest(conn);
}
else if(instate == FTP_RETR_SIZE) {
Curl_pgrsSetDownloadSize(data, filesize);
- result = ftp_state_post_retr_size(conn, filesize);
+ result = ftp_state_retr(conn, filesize);
}
else if(instate == FTP_STOR_SIZE) {
data->state.resume_from = filesize;
return result;
}
#endif
- result = ftp_state_post_rest(conn);
+ result = ftp_state_prepare_transfer(conn);
break;
case FTP_RETR_REST:
PPSENDF(&ftpc->pp, "CWD %s", ftpc->dirs[ftpc->count1 - 1]);
}
else {
- result = ftp_state_post_cwd(conn);
+ result = ftp_state_mdtm(conn);
if(result)
return result;
}