summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-10-25 23:08:54 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-10-25 23:08:54 +0100
commit96450a1a33ec22cb54b20dbac08ebdf14648582f (patch)
treec3beaaf86442d1934d74a7902e53d29edb4a9a48 /lib
parente2bcdf557b16962af51a34ce493c4375e24895a7 (diff)
downloadcurl-96450a1a33ec22cb54b20dbac08ebdf14648582f.tar.gz
alt-svc: enable by default
Remove CURLALTSVC_IMMEDIATELY, which was never implemented/supported. alt-svc support in curl is no longer considered experimental Closes #5868
Diffstat (limited to 'lib')
-rw-r--r--lib/altsvc.c7
-rw-r--r--lib/altsvc.h4
-rw-r--r--lib/config-os400.h3
-rw-r--r--lib/curl_config.h.cmake4
-rw-r--r--lib/curl_get_line.c2
-rw-r--r--lib/http.c4
-rw-r--r--lib/rename.c4
-rw-r--r--lib/setopt.c2
-rw-r--r--lib/url.c2
-rw-r--r--lib/urldata.h2
-rw-r--r--lib/version.c2
11 files changed, 18 insertions, 18 deletions
diff --git a/lib/altsvc.c b/lib/altsvc.c
index d3deba3e8..8556223bb 100644
--- a/lib/altsvc.c
+++ b/lib/altsvc.c
@@ -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 */
diff --git a/lib/altsvc.h b/lib/altsvc.h
index 1aeb625ab..cc3a00464 100644
--- a/lib/altsvc.h
+++ b/lib/altsvc.h
@@ -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 */
diff --git a/lib/config-os400.h b/lib/config-os400.h
index 7beb81faf..df9c142b6 100644
--- a/lib/config-os400.h
+++ b/lib/config-os400.h
@@ -422,9 +422,6 @@
/* 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
diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake
index fc15b8a51..90809fc11 100644
--- a/lib/curl_config.h.cmake
+++ b/lib/curl_config.h.cmake
@@ -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
diff --git a/lib/curl_get_line.c b/lib/curl_get_line.c
index 3c77be9a9..ffe4256ba 100644
--- a/lib/curl_get_line.c
+++ b/lib/curl_get_line.c
@@ -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"
diff --git a/lib/http.c b/lib/http.c
index e0be17d9b..a5f42eb97 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -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) ||
diff --git a/lib/rename.c b/lib/rename.c
index fe5f95d0d..cc5c5a99f 100644
--- a/lib/rename.c
+++ b/lib/rename.c
@@ -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"
diff --git a/lib/setopt.c b/lib/setopt.c
index fa5398215..3b96289c2 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -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();
diff --git a/lib/url.c b/lib/url.c
index 8af33c040..0176517d9 100644
--- 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
diff --git a/lib/urldata.h b/lib/urldata.h
index 5ee81770e..e8b54aa30 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -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 */
diff --git a/lib/version.c b/lib/version.c
index bdeba8835..70e456658 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -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
,