Loading lib/ftp.c +26 −25 Original line number Diff line number Diff line Loading @@ -471,7 +471,7 @@ CURLcode ftp_done(struct connectdata *conn) failf(data, "Received only partial file"); return CURLE_PARTIAL_FILE; } else if(0 == *ftp->bytecountp) { else if(!data->bits.no_body && (0 == *ftp->bytecountp)) { failf(data, "No data was received!"); return CURLE_FTP_COULDNT_RETR_FILE; } Loading @@ -480,6 +480,7 @@ CURLcode ftp_done(struct connectdata *conn) sclose(data->secondarysocket); data->secondarysocket = -1; if(!data->bits.no_body) { /* now let's see what the server says about the transfer we just performed: */ nread = GetLastResponse(data->firstsocket, buf, conn); Loading @@ -491,6 +492,7 @@ CURLcode ftp_done(struct connectdata *conn) failf(data, "%s", buf+4); return CURLE_FTP_WRITE_ERROR; } } /* Send any post-transfer QUOTE strings? */ if(data->postquote) { Loading Loading @@ -572,6 +574,19 @@ CURLcode _ftp(struct connectdata *conn) } } /* change directory first! */ if(ftp->dir && ftp->dir[0]) { sendf(data->firstsocket, data, "CWD %s\r\n", ftp->dir); nread = GetLastResponse(data->firstsocket, buf, conn); if(nread < 0) return CURLE_OPERATION_TIMEOUTED; if(strncmp(buf, "250", 3)) { failf(data, "Couldn't change to directory %s", ftp->dir); return CURLE_FTP_ACCESS_DENIED; } } /* If we have selected NOBODY, it means that we only want file information. Which in FTP can't be much more than the file size! */ if(data->bits.no_body) { Loading Loading @@ -851,20 +866,6 @@ CURLcode _ftp(struct connectdata *conn) /* we have the (new) data connection ready */ infof(data, "Connected!\n"); /* change directory first */ if(ftp->dir && ftp->dir[0]) { sendf(data->firstsocket, data, "CWD %s\r\n", ftp->dir); nread = GetLastResponse(data->firstsocket, buf, conn); if(nread < 0) return CURLE_OPERATION_TIMEOUTED; if(strncmp(buf, "250", 3)) { failf(data, "Couldn't change to directory %s", ftp->dir); return CURLE_FTP_ACCESS_DENIED; } } if(data->bits.upload) { /* Set type to binary (unless specified ASCII) */ Loading lib/highlevel.c +3 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,9 @@ _Transfer(struct connectdata *c_conn) if(conn->size > 0) pgrsSetDownloadSize(data, conn->size); } { /* we want header and/or body, if neither then don't do this! */ if(conn->getheader || !data->bits.no_body) { fd_set readfd; fd_set writefd; fd_set rkeepfd; Loading Loading
lib/ftp.c +26 −25 Original line number Diff line number Diff line Loading @@ -471,7 +471,7 @@ CURLcode ftp_done(struct connectdata *conn) failf(data, "Received only partial file"); return CURLE_PARTIAL_FILE; } else if(0 == *ftp->bytecountp) { else if(!data->bits.no_body && (0 == *ftp->bytecountp)) { failf(data, "No data was received!"); return CURLE_FTP_COULDNT_RETR_FILE; } Loading @@ -480,6 +480,7 @@ CURLcode ftp_done(struct connectdata *conn) sclose(data->secondarysocket); data->secondarysocket = -1; if(!data->bits.no_body) { /* now let's see what the server says about the transfer we just performed: */ nread = GetLastResponse(data->firstsocket, buf, conn); Loading @@ -491,6 +492,7 @@ CURLcode ftp_done(struct connectdata *conn) failf(data, "%s", buf+4); return CURLE_FTP_WRITE_ERROR; } } /* Send any post-transfer QUOTE strings? */ if(data->postquote) { Loading Loading @@ -572,6 +574,19 @@ CURLcode _ftp(struct connectdata *conn) } } /* change directory first! */ if(ftp->dir && ftp->dir[0]) { sendf(data->firstsocket, data, "CWD %s\r\n", ftp->dir); nread = GetLastResponse(data->firstsocket, buf, conn); if(nread < 0) return CURLE_OPERATION_TIMEOUTED; if(strncmp(buf, "250", 3)) { failf(data, "Couldn't change to directory %s", ftp->dir); return CURLE_FTP_ACCESS_DENIED; } } /* If we have selected NOBODY, it means that we only want file information. Which in FTP can't be much more than the file size! */ if(data->bits.no_body) { Loading Loading @@ -851,20 +866,6 @@ CURLcode _ftp(struct connectdata *conn) /* we have the (new) data connection ready */ infof(data, "Connected!\n"); /* change directory first */ if(ftp->dir && ftp->dir[0]) { sendf(data->firstsocket, data, "CWD %s\r\n", ftp->dir); nread = GetLastResponse(data->firstsocket, buf, conn); if(nread < 0) return CURLE_OPERATION_TIMEOUTED; if(strncmp(buf, "250", 3)) { failf(data, "Couldn't change to directory %s", ftp->dir); return CURLE_FTP_ACCESS_DENIED; } } if(data->bits.upload) { /* Set type to binary (unless specified ASCII) */ Loading
lib/highlevel.c +3 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,9 @@ _Transfer(struct connectdata *c_conn) if(conn->size > 0) pgrsSetDownloadSize(data, conn->size); } { /* we want header and/or body, if neither then don't do this! */ if(conn->getheader || !data->bits.no_body) { fd_set readfd; fd_set writefd; fd_set rkeepfd; Loading