1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-16 06:25:03 -05:00

ftp range downloads make us ignore the final status message as the server

will most likely treat the download as failed as we might abort it
pre-maturely
This commit is contained in:
Daniel Stenberg 2002-06-11 12:35:03 +00:00
parent 109cbbe9c5
commit 4fe252847c

View File

@ -656,13 +656,14 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
sclose(conn->secondarysocket); sclose(conn->secondarysocket);
conn->secondarysocket = -1; conn->secondarysocket = -1;
if(!data->set.no_body && !conn->bits.resume_done) {
/* now let's see what the server says about the transfer we /* now let's see what the server says about the transfer we
just performed: */ just performed: */
nread = Curl_GetFTPResponse(buf, conn, &ftpcode); nread = Curl_GetFTPResponse(buf, conn, &ftpcode);
if(nread < 0) if(nread < 0)
return CURLE_OPERATION_TIMEOUTED; return CURLE_OPERATION_TIMEOUTED;
if(!data->set.no_body && !conn->bits.resume_done) {
/* 226 Transfer complete, 250 Requested file action okay, completed. */ /* 226 Transfer complete, 250 Requested file action okay, completed. */
if((ftpcode != 226) && (ftpcode != 250)) { if((ftpcode != 226) && (ftpcode != 250)) {
failf(data, "server did not report OK, got %d", ftpcode); failf(data, "server did not report OK, got %d", ftpcode);
@ -1787,6 +1788,7 @@ CURLcode ftp_perform(struct connectdata *conn)
} }
infof(data, "range-download from %d to %d, totally %d bytes\n", infof(data, "range-download from %d to %d, totally %d bytes\n",
from, to, totalsize); from, to, totalsize);
conn->bits.resume_done = TRUE; /* to prevent some error due to this */
} }
if((data->set.ftp_list_only) || !ftp->file) { if((data->set.ftp_list_only) || !ftp->file) {