]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
c-hyper: fix the uploaded field in progress callbacks
authorDaniel Stenberg <daniel@haxx.se>
Tue, 8 Jun 2021 08:11:28 +0000 (10:11 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 10 Jun 2021 06:42:15 +0000 (08:42 +0200)
Makes test 578 work

Closes #7209

lib/c-hyper.c

index 117912815a5e9287ad19f5c47ece3d27d4c6f428..c7102979efe12e2936bd8e071750268bd7f80ae7 100644 (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;
 }