sendf: add condition to max-filesize check

Since the max filesize check should not be performed while the body is
ignored.

Follow-up to aef384a7df
Closes #14958
This commit is contained in:
Daniel Stenberg 2024-09-18 14:09:08 +02:00
parent 7eb8c04847
commit 6d0a48e586
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -300,7 +300,7 @@ static CURLcode cw_download_write(struct Curl_easy *data,
/* Error on too large filesize is handled below, after writing
* the permitted bytes */
if(data->set.max_filesize) {
if(data->set.max_filesize && !data->req.ignorebody) {
size_t wmax = get_max_body_write_len(data, data->set.max_filesize);
if(nwrite > wmax) {
nwrite = wmax;