diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-02-11 16:30:32 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-02-12 08:13:37 +0100 |
commit | 88dd1a8a115b1f5ece26fd8941b4464973b7d913 (patch) | |
tree | 2dff281d92e8795a15520ef3568fb55ec7a32fbc /lib/urldata.h | |
parent | bd6b54ba1f55b579b7fc90de271bb1992a8fb975 (diff) | |
download | curl-88dd1a8a115b1f5ece26fd8941b4464973b7d913.tar.gz |
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
Diffstat (limited to 'lib/urldata.h')
-rw-r--r-- | lib/urldata.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/urldata.h b/lib/urldata.h index 6a9c52c44..b78bf905c 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -991,7 +991,7 @@ struct connectdata { char *passwd; /* password string, allocated */ char *options; /* options string, allocated */ char *sasl_authzid; /* authorisation identity string, allocated */ - int httpversion; /* the HTTP version*10 reported by the server */ + unsigned char httpversion; /* the HTTP version*10 reported by the server */ struct curltime now; /* "current" time */ struct curltime created; /* creation time */ struct curltime lastused; /* when returned to the connection cache */ @@ -1375,9 +1375,10 @@ struct UrlState { /* a place to store the most recently set FTP entrypath */ char *most_recent_ftp_entrypath; - - int httpversion; /* the lowest HTTP version*10 reported by any server - involved in this request */ + unsigned char httpwant; /* when non-zero, a specific HTTP version requested + to be used in the library's request(s) */ + unsigned char httpversion; /* the lowest HTTP version*10 reported by any + server involved in this request */ #if !defined(WIN32) && !defined(MSDOS) && !defined(__EMX__) /* do FTP line-end conversions on most platforms */ @@ -1718,8 +1719,8 @@ struct UserDefined { curl_proxytype proxytype; /* what kind of proxy that is in use */ time_t timevalue; /* what time to compare with */ Curl_HttpReq method; /* what kind of HTTP request (if any) is this */ - long httpversion; /* when non-zero, a specific HTTP version requested to - be used in the library's request(s) */ + unsigned char httpwant; /* when non-zero, a specific HTTP version requested + to be used in the library's request(s) */ struct ssl_config_data ssl; /* user defined SSL stuff */ #ifndef CURL_DISABLE_PROXY struct ssl_config_data proxy_ssl; /* user defined SSL stuff for proxy */ |