c-hyper: remove the hyper_executor_poll() loop from Curl_http

1. it's superfluous
2. it didn't work identically to the Curl_hyper_stream one which could
   cause problems like #7486

Pointed-out-by: David Cook
Closes #7499
This commit is contained in:
Daniel Stenberg 2021-07-26 14:54:13 +02:00
parent 1e5e93d899
commit 2c688a4aae
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -341,8 +341,7 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data,
hyper_task_free(task);
if(t == HYPER_TASK_ERROR) {
hyper_code errnum = hyper_error_code(hypererr);
if(errnum == HYPERE_ABORTED_BY_CALLBACK) {
if(data->state.hresult) {
/* override Hyper's view, might not even be an error */
result = data->state.hresult;
infof(data, "hyperstream is done (by early callback)");
@ -352,7 +351,9 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data,
size_t errlen = hyper_error_print(hypererr, errbuf, sizeof(errbuf));
hyper_code code = hyper_error_code(hypererr);
failf(data, "Hyper: [%d] %.*s", (int)code, (int)errlen, errbuf);
if((code == HYPERE_UNEXPECTED_EOF) && !data->req.bytecount)
if(code == HYPERE_ABORTED_BY_CALLBACK)
result = CURLE_OK;
else if((code == HYPERE_UNEXPECTED_EOF) && !data->req.bytecount)
result = CURLE_GOT_NOTHING;
else if(code == HYPERE_INVALID_PEER_MESSAGE)
result = CURLE_UNSUPPORTED_PROTOCOL; /* maybe */
@ -694,7 +695,6 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
hyper_request *req = NULL;
hyper_headers *headers = NULL;
hyper_task *handshake = NULL;
hyper_error *hypererr = NULL;
CURLcode result;
const char *p_accept; /* Accept: string */
const char *method;
@ -932,18 +932,6 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
hyper_clientconn_free(client);
do {
task = hyper_executor_poll(h->exec);
if(task) {
bool error = hyper_task_type(task) == HYPER_TASK_ERROR;
if(error)
hypererr = hyper_task_value(task);
hyper_task_free(task);
if(error)
goto error;
}
} while(task);
if((httpreq == HTTPREQ_GET) || (httpreq == HTTPREQ_HEAD)) {
/* HTTP GET/HEAD download */
Curl_pgrsSetUploadSize(data, 0); /* nothing */
@ -967,15 +955,6 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
if(handshake)
hyper_task_free(handshake);
if(hypererr) {
uint8_t errbuf[256];
size_t errlen = hyper_error_print(hypererr, errbuf, sizeof(errbuf));
hyper_code code = hyper_error_code(hypererr);
failf(data, "Hyper: [%d] %.*s", (int)code, (int)errlen, errbuf);
hyper_error_free(hypererr);
if(data->state.hresult)
return data->state.hresult;
}
return CURLE_OUT_OF_MEMORY;
}