diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-08-23 14:20:08 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-08-23 16:12:33 +0200 |
commit | e5d77dc2ca7d047a55aa56f156f5651352386c1b (patch) | |
tree | f1b2f041010c5c63b4ecc5c801e78e0ce149d81a /lib/c-hyper.c | |
parent | 38941ad6f315b9277833df74b9feb6b2df3f50e2 (diff) | |
download | curl-e5d77dc2ca7d047a55aa56f156f5651352386c1b.tar.gz |
c-hyper: handle HTTP/1.1 => HTTP/1.0 downgrade on reused connection
Enable test 1074
Closes #7617
Diffstat (limited to 'lib/c-hyper.c')
-rw-r--r-- | lib/c-hyper.c | 5 |
1 files changed, 4 insertions, 1 deletions
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"); |