}
/* either we just wrote the newline or it is part of the next
* chunk of bytes we write. */
- data->state.crlf_conversions++;
ctx->newline_pending = FALSE;
}
/* EndOfStream, if we have a trailing cr, now is the time to write it */
if(ctx->newline_pending) {
ctx->newline_pending = FALSE;
- data->state.crlf_conversions++;
return Curl_cwriter_write(data, writer->next, type, &nl, 1);
}
/* Always pass on the EOS type indicator */
else {
if((-1 != data->req.size) &&
(data->req.size != data->req.bytecount) &&
-#ifdef CURL_DO_LINEEND_CONV
- /* Most FTP servers do not adjust their file SIZE response for CRLFs,
- * so we will check to see if the discrepancy can be explained by the
- * number of CRLFs we have changed to LFs.
- */
- ((data->req.size + data->state.crlf_conversions) !=
- data->req.bytecount) &&
-#endif /* CURL_DO_LINEEND_CONV */
(data->req.maxdownload != data->req.bytecount)) {
failf(data, "Received only partial file: %" CURL_FORMAT_CURL_OFF_T
" bytes", data->req.bytecount);
* returning.
*/
if(!(data->req.no_body) && (k->size != -1) &&
- (k->bytecount != k->size) &&
-#ifdef CURL_DO_LINEEND_CONV
- /* Most FTP servers do not adjust their file SIZE response for CRLFs,
- so we will check to see if the discrepancy can be explained
- by the number of CRLFs we have changed to LFs.
- */
- (k->bytecount != (k->size + data->state.crlf_conversions)) &&
-#endif /* CURL_DO_LINEEND_CONV */
- !k->newurl) {
+ (k->bytecount != k->size) && !k->newurl) {
failf(data, "transfer closed with %" CURL_FORMAT_CURL_OFF_T
" bytes remaining to read", k->size - k->bytecount);
result = CURLE_PARTIAL_FILE;
return result;
}
-#ifdef CURL_DO_LINEEND_CONV
- data->state.crlf_conversions = 0; /* reset CRLF conversion counter */
-#endif /* CURL_DO_LINEEND_CONV */
-
/* set start time here for timeout purposes in the connect procedure, it
is later set again for the progress meter purpose */
conn->now = Curl_now();
#define CURL_DEFAULT_USER "anonymous"
#define CURL_DEFAULT_PASSWORD "ftp@example.com"
+#if !defined(_WIN32) && !defined(MSDOS) && !defined(__EMX__)
+/* do FTP line-end conversions on most platforms */
+#define CURL_DO_LINEEND_CONV
+#endif
+
/* Convenience defines for checking protocols or their SSL based version. Each
protocol handler should only ever have a single CURLPROTO_ in its protocol
field. */
/* a place to store the most recently set (S)FTP entrypath */
char *most_recent_ftp_entrypath;
-#if !defined(_WIN32) && !defined(MSDOS) && !defined(__EMX__)
-/* do FTP line-end conversions on most platforms */
-#define CURL_DO_LINEEND_CONV
- /* for FTP downloads: how many CRLFs did we converted to LFs? */
- curl_off_t crlf_conversions;
-#endif
char *range; /* range, if used. See README for detailed specification on
this syntax. */
curl_off_t resume_from; /* continue [ftp] transfer from here */