c-hyper: fix the uploaded field in progress callbacks

Makes test 578 work

Closes #7209
This commit is contained in:
Daniel Stenberg 2021-06-08 10:11:28 +02:00
parent cd5ca9bb38
commit 372361f6ca
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 8 additions and 0 deletions

View File

@ -562,6 +562,10 @@ static int uploadpostfields(void *userdata, hyper_context *ctx,
*chunk = copy;
else
return HYPER_POLL_ERROR;
/* increasing the writebytecount here is a little premature but we
don't know exactly when the body is sent*/
data->req.writebytecount += (size_t)data->req.p.http->postsize;
Curl_pgrsSetUploadCounter(data, data->req.writebytecount);
data->req.upload_done = TRUE;
}
return HYPER_POLL_READY;
@ -586,6 +590,10 @@ static int uploadstreamed(void *userdata, hyper_context *ctx,
*chunk = copy;
else
return HYPER_POLL_ERROR;
/* increasing the writebytecount here is a little premature but we
don't know exactly when the body is sent*/
data->req.writebytecount += fillcount;
Curl_pgrsSetUploadCounter(data, fillcount);
}
return HYPER_POLL_READY;
}