aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-01-19 21:39:10 +0000
committerDaniel Stenberg <daniel@haxx.se>2010-01-19 21:39:10 +0000
commita5ca3f175470e5ca82686b0356c0a1691ac08758 (patch)
tree4899b0713a5f2fbbde3db40d0dc70a1b6be6ee44 /lib/ftp.c
parent77a17a21d11e067caeae9ef9c59d6c62a3ce355c (diff)
- David McCreedy brought a fix and a new test case (129) to make libcurl work
again when downloading files over FTP using ASCII and it turns out that the final size of the file is not the same as the initial size the server reported. This is very common since servers don't take the newline conversions into account.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 497759f10..0984ca961 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2204,6 +2204,8 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
if(size > data->req.maxdownload && data->req.maxdownload > 0)
size = data->req.size = data->req.maxdownload;
+ else if((instate != FTP_LIST) && (data->set.prefer_ascii))
+ size = -1; /* kludge for servers that understate ASCII mode file size */
infof(data, "Maxdownload = %" FORMAT_OFF_T "\n", data->req.maxdownload);