From 9be71208d2fbf2a322f234499288b695cc142e55 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 4 Jan 2021 16:55:30 +0100 Subject: c-hyper: make CURLE_GOT_NOTHING work Test 30 --- lib/c-hyper.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/c-hyper.c b/lib/c-hyper.c index b6eb7466d..95299e0b8 100644 --- a/lib/c-hyper.c +++ b/lib/c-hyper.c @@ -318,8 +318,12 @@ static CURLcode hyperstream(struct Curl_easy *data, else { uint8_t errbuf[256]; size_t errlen = hyper_error_print(hypererr, errbuf, sizeof(errbuf)); - failf(data, "Hyper: %.*s", (int)errlen, errbuf); - result = CURLE_RECV_ERROR; /* not a very good return code */ + 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) + result = CURLE_GOT_NOTHING; + else + result = CURLE_RECV_ERROR; } *done = TRUE; hyper_error_free(hypererr); @@ -885,7 +889,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) if(hypererr) { uint8_t errbuf[256]; size_t errlen = hyper_error_print(hypererr, errbuf, sizeof(errbuf)); - failf(data, "Hyper: %.*s", (int)errlen, errbuf); + hyper_code code = hyper_error_code(hypererr); + failf(data, "Hyper: [%d] %.*s", (int)code, (int)errlen, errbuf); hyper_error_free(hypererr); } return CURLE_OUT_OF_MEMORY; -- cgit v1.2.1