vtls: fix build error when proxy-disabled

Closes #10901
This commit is contained in:
Daniel Stenberg 2023-04-06 16:34:21 +02:00
parent 356dd0b73a
commit 0ba120e307
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -2034,12 +2034,18 @@ CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf,
size_t proto_len)
{
int can_multi = 0;
unsigned char *palpn = Curl_ssl_cf_is_proxy(cf)?
&cf->conn->proxy_alpn : &cf->conn->alpn;
unsigned char *palpn =
#ifndef CURL_DISABLE_PROXY
Curl_ssl_cf_is_proxy(cf)?
&cf->conn->proxy_alpn : &cf->conn->alpn
#else
&cf->conn->alpn
#endif
;
if(proto && proto_len) {
if(proto_len == ALPN_HTTP_1_1_LENGTH &&
!memcmp(ALPN_HTTP_1_1, proto, ALPN_HTTP_1_1_LENGTH)) {
!memcmp(ALPN_HTTP_1_1, proto, ALPN_HTTP_1_1_LENGTH)) {
*palpn = CURL_HTTP_VERSION_1_1;
}
else if(proto_len == ALPN_HTTP_1_0_LENGTH &&
@ -2055,7 +2061,7 @@ CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf,
#endif
#ifdef USE_HTTP3
else if(proto_len == ALPN_H3_LENGTH &&
!memcmp(ALPN_H3, proto, ALPN_H3_LENGTH)) {
!memcmp(ALPN_H3, proto, ALPN_H3_LENGTH)) {
*palpn = CURL_HTTP_VERSION_3;
can_multi = 1;
}