aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-11-29 22:14:33 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-11-29 22:14:33 +0000
commitf75ba55b517a0c84a1ea91e805a3998b0631b88f (patch)
tree1e7a12b3b87f5d8435624cf88079969a1f5d1b5b /lib/ftp.c
parent46e6115d7264892bbd9154a7f453070dce208689 (diff)
Fixed the resumed FTP upload loop to not require that the read callback
returns a full buffer on each invoke.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index fd24ff4df..9406f2935 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1570,12 +1570,13 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
conn->fread_in);
passed += actuallyread;
- if(actuallyread != readthisamountnow) {
- failf(data, "Could only read %" FORMAT_OFF_T
- " bytes from the input", passed);
+ if((actuallyread <= 0) || (actuallyread > readthisamountnow)) {
+ /* this checks for greater-than only to make sure that the
+ CURL_READFUNC_ABORT return code still aborts */
+ failf(data, "Failed to read data");
return CURLE_FTP_COULDNT_USE_REST;
}
- } while(passed != data->state.resume_from);
+ } while(passed < data->state.resume_from);
/* now, decrease the size of the read */
if(data->set.infilesize>0) {