]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
c-hyper: poll the tasks until end correctly
authorDaniel Stenberg <daniel@haxx.se>
Tue, 5 Jan 2021 10:47:22 +0000 (11:47 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 5 Jan 2021 14:33:47 +0000 (15:33 +0100)
... makes test 36 work.

Closes #6412

lib/c-hyper.c
lib/c-hyper.h

index 9ee17e3f8e3430135173dc0185ae06af14fa624a..19ba8d9b84c71b427a88576dc3b20cd6b1c5f6f8 100644 (file)
@@ -329,7 +329,7 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data,
       hyper_error_free(hypererr);
       break;
     }
-    else if(h->init) {
+    else if(h->endtask == task) {
       /* end of transfer */
       *done = TRUE;
       infof(data, "hyperstream is done!\n");
@@ -341,7 +341,6 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data,
     }
     /* HYPER_TASK_RESPONSE */
 
-    h->init = TRUE;
     *didwhat = KEEP_RECV;
     if(!resp) {
       failf(data, "hyperstream: couldn't get response");
@@ -403,6 +402,7 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data,
       result = CURLE_OUT_OF_MEMORY;
       break;
     }
+    h->endtask = foreach;
 
     hyper_response_free(resp);
     resp = NULL;
index e2ff743b28e98ed860dee4efca87d7b35fb65478..d60ed78d1df82c2641f4db611646a5d8881255f9 100644 (file)
@@ -32,7 +32,7 @@ struct hyptransfer {
   hyper_waker *write_waker;
   hyper_waker *read_waker;
   const hyper_executor *exec;
-  bool init;
+  hyper_task *endtask;
 };
 
 size_t Curl_hyper_recv(void *userp, hyper_context *ctx,