diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-02-11 16:30:32 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-02-11 16:30:32 +0100 |
commit | ffec6111a5dba38dc418b5583b03fab0052b05f6 (patch) | |
tree | 23f6ec48ae762dde34fc4c656a6072ab820e931f /lib/vtls/wolfssl.c | |
parent | 1560cd1f9f5a2ecfe91d138a3189160c212855a4 (diff) | |
download | curl-ffec6111a5dba38dc418b5583b03fab0052b05f6.tar.gz |
urldata: don't touch data->set.httpversion at run-timebagder/http-state-version
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/vtls/wolfssl.c')
-rw-r--r-- | lib/vtls/wolfssl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 169614c29..dc79d8b14 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -475,7 +475,7 @@ wolfssl_connect_step1(struct Curl_easy *data, struct connectdata *conn, protocols in descending order of preference, eg: "h2,http/1.1" */ #ifdef USE_NGHTTP2 - if(data->set.httpversion >= CURL_HTTP_VERSION_2) { + if(data->state.httpversion >= CURL_HTTP_VERSION_2) { strcpy(protocols + strlen(protocols), NGHTTP2_PROTO_VERSION_ID ","); infof(data, "ALPN, offering %s\n", NGHTTP2_PROTO_VERSION_ID); } @@ -724,7 +724,7 @@ wolfssl_connect_step2(struct Curl_easy *data, struct connectdata *conn, !memcmp(protocol, ALPN_HTTP_1_1, ALPN_HTTP_1_1_LENGTH)) conn->negnpn = CURL_HTTP_VERSION_1_1; #ifdef USE_NGHTTP2 - else if(data->set.httpversion >= CURL_HTTP_VERSION_2 && + else if(data->state.httpversion >= CURL_HTTP_VERSION_2 && protocol_len == NGHTTP2_PROTO_VERSION_ID_LEN && !memcmp(protocol, NGHTTP2_PROTO_VERSION_ID, NGHTTP2_PROTO_VERSION_ID_LEN)) |