]> git.ipfire.org Git - thirdparty/curl.git/commit
lib: clarify 'conn->httpversion'
authorStefan Eissing <stefan@eissing.org>
Wed, 22 Jan 2025 13:45:30 +0000 (14:45 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 24 Jan 2025 09:59:02 +0000 (10:59 +0100)
commite83818cae1da495939aee5def1172ca1d20cc1e4
tree18add571eef7d40aac3dfcc7a68ea4a8c9c657ea
parent7e814c8717939393d4436d75f5f0c3ffa98c8c53
lib: clarify 'conn->httpversion'

The variable `conn->httpversion` was used for several purposes and it
was unclear at which time the value represents what.

- rename `conn->httpversion` to `conn->httpversion_seen`
  This makes clear that the variable only records the last
  HTTP version seen on the connection - if any. And that it
  no longer is an indication of what version to use.
- Change Alt-Svc handling to no longer modify `conn->httpversion`
  but set `data->state.httpwant` for influencing the HTTP version
  to use on a transfer.
- Add `data->req.httpversion_sent` to have a record of what
  HTTP version was sent in a request
- Add connection filter type CF_TYPE_HTTP
- Add filter query `CF_QUERY_HTTP_VERSION` to ask what HTTP
  filter version is in place
- Lookup filters HTTP version instead of using `conn->httpversion`

Test test_12_05 now switches to HTTP/1.1 correctly and the
expectations have been fixed.

Removed the connection fitler "is_httpN()" checks and using
the version query instead.

Closes #16073
21 files changed:
lib/cfilters.c
lib/cfilters.h
lib/http.c
lib/http.h
lib/http2.c
lib/http2.h
lib/http_proxy.c
lib/request.c
lib/request.h
lib/rtsp.c
lib/transfer.c
lib/url.c
lib/urldata.h
lib/vquic/curl_msh3.c
lib/vquic/curl_ngtcp2.c
lib/vquic/curl_osslq.c
lib/vquic/curl_quiche.c
lib/vquic/vquic.c
lib/vquic/vquic.h
tests/data/test471
tests/http/test_12_reuse.py