From 1eedad27a23e2158d5939deda66182f97cfe2212 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 8 Aug 2006 22:56:46 +0000 Subject: 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. --- lib/ftp.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib') 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); -- cgit v1.2.3