diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-03-08 08:09:14 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-03-08 08:09:14 +0000 |
commit | 702664e9591197c10ec36ab7a0ab7395b77726d7 (patch) | |
tree | bb85a68dd1afdce9062a51aa0766d81705098ea3 /lib | |
parent | 18d87edd6d155c8f94233f8e0c32aa1b7434a038 (diff) |
Dominick Meglio reported that using CURLOPT_FILETIME when transferring a FTP
file got a Last-Modified: header written to the data stream, corrupting the
actual data. This was because some conditions from the previous FTP code was
not properly brought into the new FTP code. I fixed and I added test case 520
to verify. (This bug was introduced in 7.13.1)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftp.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1741,7 +1741,11 @@ static CURLcode ftp_state_mdtm_resp(struct connectdata *conn, /* If we asked for a time of the file and we actually got one as well, we "emulate" a HTTP-style header in our output. */ - if(data->set.get_filetime && (data->info.filetime>=0) ) { + if(conn->bits.no_body && + data->set.include_header && + ftp->file && + data->set.get_filetime && + (data->info.filetime>=0) ) { struct tm *tm; time_t clock = (time_t)data->info.filetime; #ifdef HAVE_GMTIME_R @@ -1763,7 +1767,7 @@ static CURLcode ftp_state_mdtm_resp(struct connectdata *conn, result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0); if(result) return result; - } + } /* end of a ridiculous amount of conditionals */ } break; default: |