From 372361f6ca1ea77db143187a3b2e1f4a21ec0afc Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 8 Jun 2021 10:11:28 +0200 Subject: [PATCH] c-hyper: fix the uploaded field in progress callbacks Makes test 578 work Closes #7209 --- lib/c-hyper.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/c-hyper.c b/lib/c-hyper.c index 117912815..c7102979e 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; }