aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-04-26 07:40:37 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-04-26 07:40:37 +0000
commit95152aec685c4d11de6cb25802303e4872d51b3e (patch)
tree213409d6a9103d2b2be41474782cdd0ffd3ef28f /lib/ftp.c
parent8ed676236395ef970e7c3b74aebbd1f8eef837ba (diff)
David McCreedy brought line end conversions when doing FTP ASCII
transfers. They are done on non-windows systems and translate CRLF to LF.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 31921e657..9b6ba2154 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2994,6 +2994,13 @@ CURLcode Curl_ftp_done(struct connectdata *conn, CURLcode status)
}
else {
if((-1 != conn->size) && (conn->size != *ftp->bytecountp) &&
+#ifdef CURL_DO_LINEEND_CONV
+ /* Most FTP servers don't adjust their file SIZE response for CRLFs, so
+ * we'll check to see if the discrepancy can be explained by the number
+ * of CRLFs we've changed to LFs.
+ */
+ ((conn->size + data->state.crlf_conversions) != *ftp->bytecountp) &&
+#endif /* CURL_DO_LINEEND_CONV */
(conn->maxdownload != *ftp->bytecountp)) {
failf(data, "Received only partial file: %" FORMAT_OFF_T " bytes",
*ftp->bytecountp);