mirror of
https://github.com/curl/curl.git
synced 2026-08-25 06:53:31 +03:00
lib: let the max filesize option stop too big transfers too
Previously it would only stop them from getting started if the size is known to be too big then. Update the libcurl and curl docs accordingly. Fixes #11810 Reported-by: Elliot Killick Assisted-by: Jay Satiro Closes #11820
This commit is contained in:
parent
38029101e2
commit
914e49b9b7
13 changed files with 55 additions and 15 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue