aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--CHANGES7
-rw-r--r--RELEASE-NOTES3
-rw-r--r--lib/ftp.c2
-rw-r--r--tests/data/Makefile.am2
4 files changed, 12 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 43752e72c..79ab4f630 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,13 @@
Changelog
+Daniel Stenberg (19 Jan 2010)
+- 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.
+
Kamil Dudka (14 Jan 2010)
- Suppressed side effect of OpenSSL configure checks, which prevented NSS from
being properly detected under certain circumstances. It had been caused by
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index fc236e7ae..37b314c1e 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -45,6 +45,7 @@ This release includes the following bugfixes:
o OpenSSL session id ref count leak
o progress callback called repeatedly during slow connects
o curl_multi_fdset() would return -1 too often during SCP/SFTP transfers
+ o FTP file size checks with ASCII transfers
This release includes the following known bugs:
@@ -58,6 +59,6 @@ advice from friends like these:
Marc Kleine-Budde, Jad Chamcham, Bjorn Augustsson, David Byron,
Markus Koetter, Chad Monroe, Martin Storsjo, Siegfried Gyuricsko,
Jon Nelson, Julien Chaffraix, Renato Botelho, Peter Pentchev, Ingmar Runge,
- Johan van Selst, Charles Kerr, Gil Weber
+ Johan van Selst, Charles Kerr, Gil Weber, David McCreedy
Thanks! (and sorry if I forgot to mention someone)
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);
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index 18da49a15..993c40ca4 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -64,7 +64,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
test1097 test560 test561 test1098 test1099 test562 test563 test1100 \
test564 test1101 test1102 test1103 test1104 test299 test310 test311 \
test312 test1105 test565 test800 test1106 test801 test566 test802 test803 \
- test1107 test1108 test1109 test1110 test1111 test1112
+ test1107 test1108 test1109 test1110 test1111 test1112 test129
filecheck:
@mkdir test-place; \