c-hyper: handle HTTP/1.1 => HTTP/1.0 downgrade on reused connection

Enable test 1074

Closes #7617
This commit is contained in:
Daniel Stenberg 2021-08-23 14:20:08 +02:00
parent 38941ad6f3
commit e5d77dc2ca
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 11 additions and 7 deletions

View file

@ -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");