]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vtls: fix build error when proxy-disabled
authorDaniel Stenberg <daniel@haxx.se>
Thu, 6 Apr 2023 14:34:21 +0000 (16:34 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 6 Apr 2023 21:50:48 +0000 (23:50 +0200)
Closes #10901

lib/vtls/vtls.c

index 8b6a7bf0cface45497fa48c83cf4ea3d598b8151..1fa05dca39310b7135517ac6c402a253dc11c67a 100644 (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;
     }