From e5d77dc2ca7d047a55aa56f156f5651352386c1b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 23 Aug 2021 14:20:08 +0200 Subject: c-hyper: handle HTTP/1.1 => HTTP/1.0 downgrade on reused connection Enable test 1074 Closes #7617 --- lib/c-hyper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/c-hyper.c') diff --git a/lib/c-hyper.c b/lib/c-hyper.c index f17180bc8..c43d9e327 100644 --- a/lib/c-hyper.c +++ b/lib/c-hyper.c @@ -257,6 +257,9 @@ static CURLcode status_line(struct Curl_easy *data, conn->httpversion = http_version == HYPER_HTTP_VERSION_1_1 ? 11 : (http_version == HYPER_HTTP_VERSION_2 ? 20 : 10); + if(http_version == HYPER_HTTP_VERSION_1_0) + data->state.httpwant = CURL_HTTP_VERSION_1_0; + data->req.httpcode = http_status; result = Curl_http_statusline(data, conn); @@ -900,7 +903,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) goto error; } - if(data->state.httpwant == CURL_HTTP_VERSION_1_0) { + if(!Curl_use_http_1_1plus(data, conn)) { if(HYPERE_OK != hyper_request_set_version(req, HYPER_HTTP_VERSION_1_0)) { failf(data, "error setting HTTP version"); -- cgit v1.2.1