mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
make sure to "read out" the server reply even if we didn't get any data from
the server when that's the only error
This commit is contained in:
parent
92aedf850e
commit
c7cdb0f266
15
lib/ftp.c
15
lib/ftp.c
@ -558,6 +558,7 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
|
|||||||
ssize_t nread;
|
ssize_t nread;
|
||||||
char *buf = data->state.buffer; /* this is our buffer */
|
char *buf = data->state.buffer; /* this is our buffer */
|
||||||
int ftpcode;
|
int ftpcode;
|
||||||
|
CURLcode result;
|
||||||
|
|
||||||
if(data->set.upload) {
|
if(data->set.upload) {
|
||||||
if((-1 != data->set.infilesize) && (data->set.infilesize != *ftp->bytecountp)) {
|
if((-1 != data->set.infilesize) && (data->set.infilesize != *ftp->bytecountp)) {
|
||||||
@ -575,8 +576,12 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
|
|||||||
else if(!conn->bits.resume_done &&
|
else if(!conn->bits.resume_done &&
|
||||||
!data->set.no_body &&
|
!data->set.no_body &&
|
||||||
(0 == *ftp->bytecountp)) {
|
(0 == *ftp->bytecountp)) {
|
||||||
|
/* We consider this an error, but there's no true FTP error received
|
||||||
|
why we need to continue to "read out" the server response too.
|
||||||
|
We don't want to leave a "waiting" server reply if we'll get told
|
||||||
|
to make a second request on this same connection! */
|
||||||
failf(data, "No data was received!");
|
failf(data, "No data was received!");
|
||||||
return CURLE_FTP_COULDNT_RETR_FILE;
|
result = CURLE_FTP_COULDNT_RETR_FILE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,12 +609,10 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
|
|||||||
conn->bits.resume_done = FALSE; /* clean this for next connection */
|
conn->bits.resume_done = FALSE; /* clean this for next connection */
|
||||||
|
|
||||||
/* Send any post-transfer QUOTE strings? */
|
/* Send any post-transfer QUOTE strings? */
|
||||||
if(data->set.postquote) {
|
if(!result && data->set.postquote)
|
||||||
CURLcode result = ftp_sendquote(conn, data->set.postquote);
|
result = ftp_sendquote(conn, data->set.postquote);
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
return CURLE_OK;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user