summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/progress.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmcurl/lib/progress.c')
-rw-r--r--Utilities/cmcurl/lib/progress.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Utilities/cmcurl/lib/progress.c b/Utilities/cmcurl/lib/progress.c
index 6092b78..e783a9c 100644
--- a/Utilities/cmcurl/lib/progress.c
+++ b/Utilities/cmcurl/lib/progress.c
@@ -317,9 +317,16 @@ timediff_t Curl_pgrsLimitWaitTime(curl_off_t cursize,
/*
* Set the number of downloaded bytes so far.
*/
-void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size)
+CURLcode Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size)
{
+ if(data->set.max_filesize && (size > data->set.max_filesize)) {
+ failf(data, "Exceeded the maximum allowed file size "
+ "(%" CURL_FORMAT_CURL_OFF_T ")",
+ data->set.max_filesize);
+ return CURLE_FILESIZE_EXCEEDED;
+ }
data->progress.downloaded = size;
+ return CURLE_OK;
}
/*