aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-10-17 13:11:00 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-10-17 13:11:00 +0000
commitce5db9a86ea1508b0caaeec38adc5397e390dc3e (patch)
treee932aecf231b6fb77a0e98a1acfcb8caa1d80b16 /lib/ftp.c
parent94568f884dc30614f30918c9cca8cff40cc6c936 (diff)
Dominick Meglio implemented CURLOPT_MAXFILESIZE and --max-filesize.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 6ee81b5d2..4b19bd0fc 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1777,8 +1777,13 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
downloads and when talking to servers that don't give away the size
in the RETR response line. */
result = ftp_getsize(conn, ftp->file, &foundsize);
- if(CURLE_OK == result)
+ if(CURLE_OK == result) {
+ if (data->set.max_filesize && foundsize > data->set.max_filesize) {
+ failf(data, "Maximum file size exceeded");
+ return CURLE_FILESIZE_EXCEEDED;
+ }
downloadsize = foundsize;
+ }
if(conn->resume_from) {