aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-08-08 22:56:46 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-08-08 22:56:46 +0000
commit1eedad27a23e2158d5939deda66182f97cfe2212 (patch)
tree052859385adef0b9ca8813884fd8cbbadfdbf42e /lib
parentac02d379ba4580a2ff4e5b12eaea12edca0a2250 (diff)
Armel Asselin made the CURLOPT_PREQUOTE option work fine even when
CURLOPT_NOBODY is set true. PREQUOTE is then run roughly at the same place in the command sequence as it would have run if there would've been a transfer.
Diffstat (limited to 'lib')
-rw-r--r--lib/ftp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index c17d9fbaa..a52ad56a8 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1206,11 +1206,12 @@ static CURLcode ftp_state_post_rest(struct connectdata *conn)
struct SessionHandle *data = conn->data;
if(ftp->no_transfer || conn->bits.no_body) {
- /* then we're done with a "head"-like request, goto STOP */
- state(conn, FTP_STOP);
-
/* doesn't transfer any data */
ftp->no_transfer = TRUE;
+
+ /* still possibly do PRE QUOTE jobs */
+ state(conn, FTP_RETR_PREQUOTE);
+ result = ftp_state_quote(conn, TRUE, FTP_RETR_PREQUOTE);
}
else if(data->set.ftp_use_port) {
/* We have chosen to use the PORT (or similar) command */
@@ -1497,8 +1498,12 @@ static CURLcode ftp_state_quote(struct connectdata *conn,
result = ftp_state_cwd(conn);
break;
case FTP_RETR_PREQUOTE:
- NBFTPSENDF(conn, "SIZE %s", ftp->file);
- state(conn, FTP_RETR_SIZE);
+ if (ftp->no_transfer)
+ state(conn, FTP_STOP);
+ else {
+ NBFTPSENDF(conn, "SIZE %s", ftp->file);
+ state(conn, FTP_RETR_SIZE);
+ }
break;
case FTP_STOR_PREQUOTE:
result = ftp_state_ul_setup(conn, FALSE);