aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-04-17 13:21:13 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-04-17 13:21:13 +0000
commit60aa975610b2e72a6625888bb530a032963b2e9c (patch)
tree970f66488cb97a07c2e3f2d7f790c66a029c2880 /lib
parent28a91082573353628d94935d84a12388995b8904 (diff)
Frederic Lepied's ftp download resume fix
Diffstat (limited to 'lib')
-rw-r--r--lib/ftp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 701b497e6..8fda9f477 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1504,7 +1504,7 @@ again:;
data->resume_from = foundsize - downloadsize;
}
else {
- if(foundsize <= data->resume_from) {
+ if(foundsize < data->resume_from) {
failf(data, "Offset (%d) was beyond file size (%d)",
data->resume_from, foundsize);
return CURLE_FTP_BAD_DOWNLOAD_RESUME;
@@ -1514,6 +1514,11 @@ again:;
}
}
+ if (downloadsize == 0) {
+ failf(data, "File already complete");
+ return CURLE_ALREADY_COMPLETE;
+ }
+
/* Set resume file transfer offset */
infof(data, "Instructs server to resume from offset %d\n",
data->resume_from);