urldata: don't touch data->set.httpversion at run-time

Rename it to 'httpwant' and make a cloned field in the state struct as
well for run-time updates.

Also: refuse non-supported HTTP versions. Verified with test 129.

Closes #6585
This commit is contained in:
Daniel Stenberg 2021-02-11 16:30:32 +01:00
parent bd6b54ba1f
commit 88dd1a8a11
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
17 changed files with 109 additions and 34 deletions

View file

@ -1431,8 +1431,8 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
data->state.followlocation = 0; /* reset the location-follow counter */
data->state.this_is_a_follow = FALSE; /* reset this */
data->state.errorbuf = FALSE; /* no error has occurred */
data->state.httpversion = 0; /* don't assume any particular server version */
data->state.httpwant = data->set.httpwant;
data->state.httpversion = 0;
data->state.authproblem = FALSE;
data->state.authhost.want = data->set.httpauth;
data->state.authproxy.want = data->set.proxyauth;