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:
Daniel Stenberg 2023-09-23 11:20:00 +02:00
parent 38029101e2
commit 914e49b9b7
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
13 changed files with 55 additions and 15 deletions

View file

@ -671,7 +671,9 @@ static CURLcode readwrite_data(struct Curl_easy *data,
k->bytecount += nread;
max_recv -= nread;
Curl_pgrsSetDownloadCounter(data, k->bytecount);
result = Curl_pgrsSetDownloadCounter(data, k->bytecount);
if(result)
goto out;
if(!k->chunk && (nread || k->badheader || is_empty_data)) {
/* If this is chunky transfer, it was already written */