From: Daniel Stenberg Date: Tue, 8 Jun 2021 08:11:28 +0000 (+0200) Subject: c-hyper: fix the uploaded field in progress callbacks X-Git-Tag: curl-7_78_0~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=372361f6ca1ea77db143187a3b2e1f4a21ec0afc;p=thirdparty%2Fcurl.git c-hyper: fix the uploaded field in progress callbacks Makes test 578 work Closes #7209 --- diff --git a/lib/c-hyper.c b/lib/c-hyper.c index 117912815a..c7102979ef 100644 --- a/lib/c-hyper.c +++ b/lib/c-hyper.c @@ -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; }