mirror of
https://github.com/curl/curl.git
synced 2026-08-25 20:23:32 +03:00
urldata: remove crlf_conversions counter
Since the introduction of client writers, we check the body length in the PROTOCOL phase and do FTP lineend conversions laster in the CONTENT_DECODING phase. This means we no longer need to count the conversions for length checks. Closes #14709
This commit is contained in:
parent
1b0568539d
commit
64ab0ace27
4 changed files with 6 additions and 29 deletions
10
lib/ftp.c
10
lib/ftp.c
|
|
@ -369,7 +369,6 @@ static CURLcode ftp_cw_lc_write(struct Curl_easy *data,
|
|||
}
|
||||
/* 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;
|
||||
}
|
||||
|
||||
|
|
@ -400,7 +399,6 @@ static CURLcode ftp_cw_lc_write(struct Curl_easy *data,
|
|||
/* 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 */
|
||||
|
|
@ -3547,14 +3545,6 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue