]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
c-hyper: fix multi-request mechanism
authorPrithvi MK <prithvikrishna49@gmail.com>
Sun, 11 Dec 2022 10:13:14 +0000 (15:43 +0530)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 11 Dec 2022 13:15:53 +0000 (14:15 +0100)
It makes test 565 run fine.

Fixes #8896
Closes #10080
Assisted-by: Daniel Stenberg
lib/c-hyper.c
tests/data/DISABLED

index 6e5e1ab1f32e0458f8cdbd16681bf31be34764b9..65f5581aeeb5365a8a667e1b3815a244094fc299 100644 (file)
@@ -699,6 +699,7 @@ static int uploadstreamed(void *userdata, hyper_context *ctx,
 {
   size_t fillcount;
   struct Curl_easy *data = (struct Curl_easy *)userdata;
+  struct connectdata *conn = (struct connectdata *)data->conn;
   CURLcode result;
   (void)ctx;
 
@@ -713,7 +714,15 @@ static int uploadstreamed(void *userdata, hyper_context *ctx,
     return HYPER_POLL_PENDING;
   }
 
-  result = Curl_fillreadbuffer(data, data->set.upload_buffer_size, &fillcount);
+  if(data->req.upload_chunky && conn->bits.authneg) {
+    fillcount = 0;
+    data->req.upload_chunky = FALSE;
+    result = CURLE_OK;
+  }
+  else {
+    result = Curl_fillreadbuffer(data, data->set.upload_buffer_size,
+                                 &fillcount);
+  }
   if(result) {
     data->state.hresult = result;
     return HYPER_POLL_ERROR;
@@ -1166,7 +1175,12 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
 
   Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"\r\n", 2);
 
-  data->req.upload_chunky = FALSE;
+  if(data->req.upload_chunky && conn->bits.authneg) {
+    data->req.upload_chunky = TRUE;
+  }
+  else {
+    data->req.upload_chunky = FALSE;
+  }
   sendtask = hyper_clientconn_send(client, req);
   if(!sendtask) {
     failf(data, "hyper_clientconn_send");
index 8e4b032aee1a4bb196e1a87fc6549228fea71094..ce40196b93e37adec2e0a85b8d707d6c67198df4 100644 (file)
@@ -65,7 +65,6 @@
 # listed below
 %if hyper
 266
-565
 579
 587
 # 1021 re-added here due to flakiness