]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
alt-svc: enable by default
authorDaniel Stenberg <daniel@haxx.se>
Sun, 25 Oct 2020 22:08:54 +0000 (23:08 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 25 Oct 2020 22:08:54 +0000 (23:08 +0100)
Remove CURLALTSVC_IMMEDIATELY, which was never implemented/supported.

alt-svc support in curl is no longer considered experimental

Closes #5868

27 files changed:
.azure-pipelines.yml
.github/workflows/macos.yml
.travis.yml
CMakeLists.txt
appveyor.yml
configure.ac
docs/ALTSVC.md
docs/CURL-DISABLE.md
docs/EXPERIMENTAL.md
docs/HTTP3.md
docs/libcurl/opts/CURLOPT_ALTSVC.3
docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.3
docs/libcurl/symbols-in-versions
include/curl/curl.h
lib/altsvc.c
lib/altsvc.h
lib/config-os400.h
lib/curl_config.h.cmake
lib/curl_get_line.c
lib/http.c
lib/rename.c
lib/setopt.c
lib/url.c
lib/urldata.h
lib/version.c
scripts/travis/script.sh
tests/unit/unit1654.c

index 57f60c95c0c8435b380212cf8306e28cf219274d..427c868d7bd7300df2be0e8e0c4113909e69fc36 100644 (file)
@@ -73,7 +73,7 @@ stages:
         torture:
           name: torture
           install: libnghttp2-dev
-          configure: --enable-debug --disable-shared --disable-threaded-resolver --enable-alt-svc
+          configure: --enable-debug --disable-shared --disable-threaded-resolver
           tests: -n -t --shallow=40 !FTP
     steps:
     - script: sudo apt-get update && sudo apt-get install -y stunnel4 python-impacket libzstd-dev libbrotli-dev $(install)
index 5d8f376bc95e16420357857278aba164a0bddbb7..e18721d71fdb6438c9e48c0d9c73d73e9192c451 100644 (file)
@@ -52,7 +52,7 @@ jobs:
           macosx-version-min: 10.9
         - name: torture
           install: nghttp2 openssl
-          configure: --enable-debug --disable-shared --disable-threaded-resolver --enable-alt-svc
+          configure: --enable-debug --disable-shared --disable-threaded-resolver
           tflags: -n -t --shallow=25 !FTP
           macosx-version-min: 10.9
         - name: macOS 10.15
index e69353574605fa54367a1ef86c2bf65fbae06974..2f036c8330896c0903f992880a64f7892d3a7531 100644 (file)
@@ -101,7 +101,7 @@ jobs:
     before_install:
     - eval "$(gimme stable)"; gimme --list  # Install latest Go (for boringssl)
   - env:
-    - T=novalgrind QUICHE="yes" C="--with-ssl=$HOME/quiche/deps/boringssl/src --with-quiche=$HOME/quiche/target/release --enable-alt-svc" LD_LIBRARY_PATH=$HOME/quiche/target/release:/usr/local/lib
+    - T=novalgrind QUICHE="yes" C="--with-ssl=$HOME/quiche/deps/boringssl/src --with-quiche=$HOME/quiche/target/release" LD_LIBRARY_PATH=$HOME/quiche/target/release:/usr/local/lib
     - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
     addons:
       apt:
@@ -115,7 +115,7 @@ jobs:
     - T=novalgrind LIBRESSL=yes C="--with-ssl=$HOME/libressl" LD_LIBRARY_PATH=/home/travis/libressl/lib:/usr/local/lib
     - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
   - env:
-    - T=novalgrind NGTCP2=yes C="--with-ssl=$HOME/ngbuild --with-ngtcp2=$HOME/ngbuild --with-nghttp3=$HOME/ngbuild --enable-alt-svc" NOTESTS=
+    - T=novalgrind NGTCP2=yes C="--with-ssl=$HOME/ngbuild --with-ngtcp2=$HOME/ngbuild --with-nghttp3=$HOME/ngbuild" NOTESTS=
     - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
     addons:
       apt:
@@ -126,7 +126,7 @@ jobs:
         - libbrotli-dev
         - libzstd-dev
   - env:
-    - T=novalgrind NGTCP2=yes GNUTLS=yes C="PKG_CONFIG_PATH=$HOME/ngbuild --without-ssl --with-gnutls=$HOME/ngbuild --with-ngtcp2=$HOME/ngbuild --with-nghttp3=$HOME/ngbuild --enable-alt-svc" NOTESTS=
+    - T=novalgrind NGTCP2=yes GNUTLS=yes C="PKG_CONFIG_PATH=$HOME/ngbuild --without-ssl --with-gnutls=$HOME/ngbuild --with-ngtcp2=$HOME/ngbuild --with-nghttp3=$HOME/ngbuild" NOTESTS=
     - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
     addons:
       apt:
@@ -192,7 +192,7 @@ jobs:
         - libbrotli-dev
         - libzstd-dev
   - env:
-    - T=debug C="--enable-alt-svc"
+    - T=debug C="--disable-alt-svc"
     - *clang
     compiler: clang
     addons:
@@ -346,7 +346,7 @@ jobs:
         - libbrotli-dev
         - libzstd-dev
   - env:
-    - T=debug C="--enable-alt-svc"
+    - T=debug C=""
     - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
     arch: arm64
     addons:
@@ -364,7 +364,7 @@ jobs:
         - zlib1g-dev
 
   - env:
-    - T=debug C="--enable-alt-svc"
+    - T=debug C=""
     - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
     arch: ppc64le
     addons:
@@ -382,7 +382,7 @@ jobs:
         - zlib1g-dev
 
   - env:
-    - T=debug C="--enable-alt-svc"
+    - T=debug C=""
     - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
     arch: s390x
     addons:
index ca77ba9464a891e07acb750ff573990889780314..f3d0a5614ff2e4fe9113629f083d83f56b753536 100644 (file)
@@ -208,9 +208,10 @@ if(HTTP_ONLY)
   set(CURL_DISABLE_TFTP ON)
 endif()
 
+option(CURL_DISABLE_ALTSVC "to disable alt-svc support" OFF)
+mark_as_advanced(CURL_DISABLE_ALTSVC)
 option(CURL_DISABLE_COOKIES "to disable cookies support" OFF)
 mark_as_advanced(CURL_DISABLE_COOKIES)
-
 option(CURL_DISABLE_CRYPTO_AUTH "to disable cryptographic authentication" OFF)
 mark_as_advanced(CURL_DISABLE_CRYPTO_AUTH)
 option(CURL_DISABLE_VERBOSE_STRINGS "to disable verbose strings" OFF)
@@ -790,8 +791,6 @@ else()
   unset(USE_UNIX_SOCKETS CACHE)
 endif()
 
-option(ENABLE_ALT_SVC "Enable alt-svc support" OFF)
-set(USE_ALTSVC ${ENABLE_ALT_SVC})
 
 #
 # CA handling
@@ -1364,7 +1363,7 @@ _add_if("Largefile"     (CURL_SIZEOF_CURL_OFF_T GREATER 4) AND
 # TODO SSP1 (Schannel) check is missing
 _add_if("SSPI"          USE_WINDOWS_SSPI)
 _add_if("GSS-API"       HAVE_GSSAPI)
-_add_if("alt-svc"       ENABLE_ALT_SVC)
+_add_if("alt-svc"       NOT CURL_DISABLE_ALTSVC)
 # TODO SSP1 missing for SPNEGO
 _add_if("SPNEGO"        NOT CURL_DISABLE_CRYPTO_AUTH AND
                         (HAVE_GSSAPI OR USE_WINDOWS_SSPI))
index 8b5e8787464667e12531e7527c88cd2200b199a7..b31a4e11e451410e8b2eeb1987936ff50836ac4b 100644 (file)
@@ -232,12 +232,12 @@ environment:
         BUILD_SYSTEM: autotools
         TESTING: ON
         DISABLED_TESTS: "!19 ~1056 !1233"
-        CONFIG_ARGS: "--enable-debug --enable-werror --enable-alt-svc --disable-threaded-resolver --disable-proxy"
+        CONFIG_ARGS: "--enable-debug --enable-werror --disable-threaded-resolver --disable-proxy"
       - APPVEYOR_BUILD_WORKER_IMAGE: "Visual Studio 2019"
         BUILD_SYSTEM: autotools
         TESTING: ON
         DISABLED_TESTS: "!19 !504 !704 !705 ~1056 !1233"
-        CONFIG_ARGS: "--enable-debug --enable-werror --enable-alt-svc --disable-threaded-resolver"
+        CONFIG_ARGS: "--enable-debug --enable-werror --disable-threaded-resolver"
       - APPVEYOR_BUILD_WORKER_IMAGE: "Visual Studio 2019"
         BUILD_SYSTEM: autotools
         TESTING: ON
index d4ccc268a01bfb4fae7362b3bdf61e170af2455f..b7a7d2daa2ae8db00961b8564462083dc53727c1 100755 (executable)
@@ -176,9 +176,12 @@ curl_verbose_msg="enabled (--disable-verbose)"
    curl_rtmp_msg="no      (--with-librtmp)"
   curl_mtlnk_msg="no      (--with-libmetalink)"
     curl_psl_msg="no      (--with-libpsl)"
-
+ curl_altsvc_msg="enabled";
     ssl_backends=
 
+
+enable_altsvc="yes"
+
 dnl
 dnl Save some initial values the user might have provided
 dnl
@@ -396,6 +399,10 @@ AC_HELP_STRING([--disable-http],[Disable HTTP support]),
        AC_SUBST(CURL_DISABLE_HTTP, [1])
        AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
        AC_SUBST(CURL_DISABLE_RTSP, [1])
+       dnl toggle off alt-svc too when HTTP is disabled
+       AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
+       curl_altsvc_msg="no";
+       enable_altsvc="no"
        ;;
   *)   AC_MSG_RESULT(yes)
        ;;
@@ -4864,7 +4871,6 @@ AC_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
 dnl ************************************************************
 dnl switch on/off alt-svc
 dnl
-curl_altsvc_msg="no      (--enable-alt-svc)";
 AC_MSG_CHECKING([whether to support alt-svc])
 AC_ARG_ENABLE(alt-svc,
 AC_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
@@ -4872,20 +4878,16 @@ AC_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
 [ case "$enableval" in
   no)
        AC_MSG_RESULT(no)
+       AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
+       curl_altsvc_msg="no";
+       enable_altsvc="no"
        ;;
   *) AC_MSG_RESULT(yes)
-       curl_altsvc_msg="enabled";
-       enable_altsvc="yes"
        ;;
   esac ],
        AC_MSG_RESULT(no)
 )
 
-if test "$enable_altsvc" = "yes"; then
-  AC_DEFINE(USE_ALTSVC, 1, [to enable alt-svc])
-  experimental="$experimental alt-svc"
-fi
-
 dnl *************************************************************
 dnl check whether ECH support, if desired, is actually available
 dnl
index 6a462bbbc86b1f778526cf936a671e26900b511e..25437d6f9aa0c8674c99d3d11ef759d7e7a0ba3c 100644 (file)
@@ -1,11 +1,13 @@
 # Alt-Svc
 
-curl features **EXPERIMENTAL** support for the Alt-Svc: HTTP header.
+curl features support for the Alt-Svc: HTTP header.
 
 ## Enable Alt-Svc in build
 
 `./configure --enable-alt-svc`
 
+(enabled by default since 7.73.0)
+
 ## Standard
 
 [RFC 7838](https://tools.ietf.org/html/rfc7838)
index a9e6acaf8fcb7817d76c27ab5139266f06b225ab..6f703a3d98d20289b9ec2c920e1d7548c2c80b5d 100644 (file)
@@ -1,5 +1,9 @@
 # Code defines to disable features and protocols
 
+## CURL_DISABLE_ALTSVC
+
+Disable support for Alt-Svc: HTTP headers.
+
 ## CURL_DISABLE_COOKIES
 
 Disable support for HTTP cookies.
index 6a014c3da7be1fbe93dc8af27085ef434d8ec270..ee5898944ba717e5cd34e79d9a6fc18933b1486b 100644 (file)
@@ -19,5 +19,4 @@ Experimental support in curl means:
 ## Experimental features right now
 
  - HTTP/3 support and options
- - alt-svc support and options
  - CURLSSLOPT_NATIVE_CA (No configure option, feature built in when supported)
index fa9d24437f5669dfafd5dcc7b73250d5d2e40f86..b32d4e3842e12e790840b743a34e8ec130be3a08 100644 (file)
@@ -65,7 +65,7 @@ Build curl
      % git clone https://github.com/curl/curl
      % cd curl
      % ./buildconf
-     % LDFLAGS="-Wl,-rpath,<somewhere1>/lib" ./configure --with-ssl=<somewhere1> --with-nghttp3=<somewhere2> --with-ngtcp2=<somewhere3> --enable-alt-svc
+     % LDFLAGS="-Wl,-rpath,<somewhere1>/lib" ./configure --with-ssl=<somewhere1> --with-nghttp3=<somewhere2> --with-ngtcp2=<somewhere3>
      % make
 
 ## Build with GnuTLS
@@ -105,7 +105,7 @@ Build curl
      % git clone https://github.com/curl/curl
      % cd curl
      % ./buildconf
-     % ./configure --without-ssl --with-gnutls=<somewhere1> --with-nghttp3=<somewhere2> --with-ngtcp2=<somewhere3> --enable-alt-svc
+     % ./configure --without-ssl --with-gnutls=<somewhere1> --with-nghttp3=<somewhere2> --with-ngtcp2=<somewhere3>
      % make
 
 # quiche version
@@ -126,7 +126,7 @@ Build curl:
      % git clone https://github.com/curl/curl
      % cd curl
      % ./buildconf
-     % ./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche/target/release" --with-ssl=$PWD/../quiche/deps/boringssl/src --with-quiche=$PWD/../quiche/target/release --enable-alt-svc
+     % ./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche/target/release" --with-ssl=$PWD/../quiche/deps/boringssl/src --with-quiche=$PWD/../quiche/target/release
      % make
 
 ## Run
index 8c7ab60a6bb263575bfa327256e9f95d315da441..0e47a401151e471388f80d6ed8003c3b37de430e 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -29,11 +29,6 @@ CURLOPT_ALTSVC \- set alt-svc cache file name
 
 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC, char *filename);
 .fi
-.SH EXPERIMENTAL
-Warning: this feature is early code and is marked as experimental. It can only
-be enabled by explicitly telling configure with \fB--enable-alt-svc\fP. You are
-advised to not ship this in production before the experimental label is
-removed.
 .SH DESCRIPTION
 Pass in a pointer to a \fIfilename\fP to instruct libcurl to use that file as
 the Alt-Svc cache to read existing cache contents from and possibly also write
index b77ef41caad1b23cba32838ecf1a2f123044816a..86074bc99271baf3baa3c645cb61cbe79b090882 100644 (file)
@@ -27,7 +27,6 @@ CURLOPT_ALTSVC_CTRL \- control alt-svc behavior
 .nf
 #include <curl/curl.h>
 
-#define CURLALTSVC_IMMEDIATELY  (1<<0)
 #define CURLALTSVC_READONLYFILE (1<<2)
 #define CURLALTSVC_H1           (1<<3)
 #define CURLALTSVC_H2           (1<<4)
@@ -35,11 +34,6 @@ CURLOPT_ALTSVC_CTRL \- control alt-svc behavior
 
 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC_CTRL, long bitmask);
 .fi
-.SH EXPERIMENTAL
-Warning: this feature is early code and is marked as experimental. It can only
-be enabled by explicitly telling configure with \fB--enable-alt-svc\fP. You are
-advised to not ship this in production before the experimental label is
-removed.
 .SH DESCRIPTION
 Populate the long \fIbitmask\fP with the correct set of features to instruct
 libcurl how to handle Alt-Svc for the transfers using this handle.
@@ -50,10 +44,6 @@ origin is properly hosted over HTTPS. These requirements are there to make
 sure both the source and the destination are legitimate.
 
 Setting any bit will enable the alt-svc engine.
-.IP "CURLALTSVC_IMMEDIATELY"
-If an Alt-Svc: header is received, this instructs libcurl to switch to one of
-those alternatives asap rather than to save it and use for the next
-request. (Not currently supported).
 .IP "CURLALTSVC_READONLYFILE"
 Do not write the alt-svc cache back to the file specified with
 \fICURLOPT_ALTSVC(3)\fP even if it gets updated. By default a file specified
index 74b95509325bf33a91ca6a064d84798344447292..1b37d13d176a844ba3cb7778f90c4e4d23bebd07 100644 (file)
@@ -15,7 +15,6 @@
 CURLALTSVC_H1                   7.64.1
 CURLALTSVC_H2                   7.64.1
 CURLALTSVC_H3                   7.64.1
-CURLALTSVC_IMMEDIATELY          7.64.1
 CURLALTSVC_READONLYFILE         7.64.1
 CURLAUTH_ANY                    7.10.6
 CURLAUTH_ANYSAFE                7.10.6
index 9026aa5c167cc434453c624464a586d64ddff67e..ad1a2097b6f10889cc8d39e2dda312204b40e5c7 100644 (file)
@@ -949,8 +949,6 @@ typedef enum {
 #define CURLHEADER_SEPARATE (1<<0)
 
 /* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
-#define CURLALTSVC_IMMEDIATELY  (1<<0)
-
 #define CURLALTSVC_READONLYFILE (1<<2)
 #define CURLALTSVC_H1           (1<<3)
 #define CURLALTSVC_H2           (1<<4)
index d3deba3e8311b6fb3c3fdeefb04fa0a1beedf770..8556223bbb429a424e6e17d7fc958a89d21d957e 100644 (file)
@@ -25,7 +25,7 @@
  */
 #include "curl_setup.h"
 
-#if !defined(CURL_DISABLE_HTTP) && defined(USE_ALTSVC)
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_ALTSVC)
 #include <curl/curl.h>
 #include "urldata.h"
 #include "altsvc.h"
@@ -457,6 +457,9 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
   struct altsvc *as;
   unsigned short dstport = srcport; /* the same by default */
   CURLcode result = getalnum(&p, alpnbuf, sizeof(alpnbuf));
+#ifdef CURL_DISABLE_VERBOSE_STRINGS
+  (void)data;
+#endif
   if(result) {
     infof(data, "Excessive alt-svc header, ignoring...\n");
     return CURLE_OK;
@@ -642,4 +645,4 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi,
   return FALSE;
 }
 
-#endif /* CURL_DISABLE_HTTP || USE_ALTSVC */
+#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_ALTSVC */
index 1aeb625ab4c4b05760bdf7470022d5d95825ff3f..cc3a00464cb5b8f9155efc7347edfb8bd8b3547e 100644 (file)
@@ -23,7 +23,7 @@
  ***************************************************************************/
 #include "curl_setup.h"
 
-#if !defined(CURL_DISABLE_HTTP) && defined(USE_ALTSVC)
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_ALTSVC)
 #include <curl/curl.h>
 #include "llist.h"
 
@@ -75,5 +75,5 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi,
 /* disabled */
 #define Curl_altsvc_save(a,b,c)
 #define Curl_altsvc_cleanup(x)
-#endif /* CURL_DISABLE_HTTP || USE_ALTSVC */
+#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_ALTSVC */
 #endif /* HEADER_CURL_ALTSVC_H */
index 7beb81fafdc7988de754173b36ac49057a0f949e..df9c142b613e89e3af5e413e236d5d0cb36c83c3 100644 (file)
 /* Define if you can safely include both <sys/time.h> and <time.h>. */
 #define TIME_WITH_SYS_TIME
 
-/* Define to enable alt-svc support (experimental) */
-#undef USE_ALTSVC
-
 /* Define to enable HTTP3 support (experimental, requires NGTCP2 or QUICHE) */
 #undef ENABLE_QUIC
 
index fc15b8a51e240541a74b8b89a6d6440667b36637..90809fc118346f6bd6da30ac4d760742a1b154cd 100644 (file)
@@ -1017,8 +1017,8 @@ ${SIZEOF_TIME_T_CODE}
 /* if Unix domain sockets are enabled  */
 #cmakedefine USE_UNIX_SOCKETS
 
-/* to enable alt-svc */
-#cmakedefine USE_ALTSVC 1
+/* to disable alt-svc */
+#cmakedefine CURL_DISABLE_ALTSVC 1
 
 /* Define to 1 if you are building a Windows target with large file support. */
 #cmakedefine USE_WIN32_LARGE_FILES 1
index 3c77be9a95bf369b9592490571c18628608e5162..ffe4256baeb02166051116995a338eb1a5ffb6c3 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "curl_setup.h"
 
-#if !defined(CURL_DISABLE_COOKIES) && !defined(CURL_DISABLE_ALTSVC)
+#if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC)
 
 #include "curl_get_line.h"
 #include "curl_memory.h"
index e0be17d9baf7d19787687a10b2b1913ea354ceaa..a5f42eb977a8d35f86ed813a99bb6943a32a63d8 100644 (file)
@@ -2518,7 +2518,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
   if(result)
     return result;
 
-#ifdef USE_ALTSVC
+#ifndef CURL_DISABLE_ALTSVC
   if(conn->bits.altused && !Curl_checkheaders(conn, "Alt-Used")) {
     altused = aprintf("Alt-Used: %s:%d\r\n",
                       conn->conn_to_host.name, conn->conn_to_port);
@@ -3992,7 +3992,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
         }
       }
     }
-#ifdef USE_ALTSVC
+#ifndef CURL_DISABLE_ALTSVC
     /* If enabled, the header is incoming and this is over HTTPS */
     else if(data->asi && checkprefix("Alt-Svc:", headp) &&
             ((conn->handler->flags & PROTOPT_SSL) ||
index fe5f95d0dfd0f280bc6eb3249f8bacec5db26025..cc5c5a99f38777f0c81168bef33bfc1b424cfb9e 100644 (file)
@@ -24,8 +24,8 @@
 
 #include "curl_setup.h"
 
-#if (!defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)) ||  \
-  defined(USE_ALTSVC)
+#if (!defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_COOKIES)) || \
+  !defined(CURL_DISABLE_ALTSVC)
 
 #include "curl_multibyte.h"
 #include "timeval.h"
index fa539821580dada5227d1c9d65d2ecea0e51f923..3b96289c253fe9da971540683e55c8c5be4bc6d0 100644 (file)
@@ -2839,7 +2839,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
     data->set.trailer_data = va_arg(param, void *);
 #endif
     break;
-#ifdef USE_ALTSVC
+#ifndef CURL_DISABLE_ALTSVC
   case CURLOPT_ALTSVC:
     if(!data->asi) {
       data->asi = Curl_altsvc_init();
index 8af33c040399d4e284288fed3229e510a1d11946..0176517d9efa1625cdf9ad83dfaae69c71d010a8 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -3095,7 +3095,7 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data,
     conn_to_host = conn_to_host->next;
   }
 
-#ifdef USE_ALTSVC
+#ifndef CURL_DISABLE_ALTSVC
   if(data->asi && !host && (port == -1) &&
      ((conn->handler->protocol == CURLPROTO_HTTPS) ||
 #ifdef CURLDEBUG
index 5ee81770eaef2a540709481f71c775367f526238..e8b54aa3072295f58b86b2a0adf1657db513de1e 100644 (file)
@@ -1899,7 +1899,7 @@ struct Curl_easy {
                                   NOTE that the 'cookie' field in the
                                   UserDefined struct defines if the "engine"
                                   is to be used or not. */
-#ifdef USE_ALTSVC
+#ifndef CURL_DISABLE_ALTSVC
   struct altsvcinfo *asi;      /* the alt-svc cache */
 #endif
   struct Progress progress;    /* for all the progress meter data */
index bdeba883573b093eab5a14b9d27cb25a2cb87281..70e456658667302f85449e233c23b1c1313fc1ae 100644 (file)
@@ -415,7 +415,7 @@ static curl_version_info_data version_info = {
 #if defined(HAVE_ZSTD)
   | CURL_VERSION_ZSTD
 #endif
-#if defined(USE_ALTSVC)
+#ifndef CURL_DISABLE_ALTSVC
   | CURL_VERSION_ALTSVC
 #endif
   ,
index 147b6288612c1e0c148d2e18f25d86de5735bd92..732a50fd7f39179888544589ffcab21d66d828ba 100755 (executable)
@@ -25,7 +25,7 @@ set -eo pipefail
 ./buildconf
 
 if [ "$T" = "coverage" ]; then
-  ./configure --enable-debug --disable-shared --disable-threaded-resolver --enable-code-coverage --enable-werror --enable-alt-svc --with-libssh2
+  ./configure --enable-debug --disable-shared --disable-threaded-resolver --enable-code-coverage --enable-werror --with-libssh2
   make
   make TFLAGS=-n test-nonflaky
   make "TFLAGS=-n -e" test-nonflaky
@@ -36,7 +36,7 @@ if [ "$T" = "coverage" ]; then
 fi
 
 if [ "$T" = "torture" ]; then
-  ./configure --enable-debug --disable-shared --disable-threaded-resolver --enable-code-coverage --enable-werror --enable-alt-svc --with-libssh2
+  ./configure --enable-debug --disable-shared --disable-threaded-resolver --enable-code-coverage --enable-werror --with-libssh2
   make
   make TFLAGS=-n test-nonflaky
   make "TFLAGS=-n -e" test-nonflaky
index 6274d0af855c36b9054aa4d5912a17268649e9b7..79f1efe958e589a36922190156b66c4bda63b0d5 100644 (file)
@@ -36,11 +36,10 @@ unit_stop(void)
   curl_global_cleanup();
 }
 
-#if defined(CURL_DISABLE_HTTP) || !defined(USE_ALTSVC)
+#if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_ALTSVC)
 UNITTEST_START
 {
-  return 0; /* nothing to do when HTTP is disabled or alt-svc support is
-               missing */
+  return 0; /* nothing to do when HTTP or alt-svc is disabled */
 }
 UNITTEST_STOP
 #else