configure: add --enable-headers-api to enable the headers API

Defaults to disabled while labeled EXPERIMENTAL.

Make all the headers API tests require 'headers-api' to run.
This commit is contained in:
Daniel Stenberg 2022-03-19 22:34:19 +01:00
parent 160b640a8b
commit 7c8c723682
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
12 changed files with 45 additions and 1 deletions

View File

@ -165,6 +165,7 @@ curl_verbose_msg="enabled (--disable-verbose)"
curl_rtmp_msg="no (--with-librtmp)"
curl_psl_msg="no (--with-libpsl)"
curl_altsvc_msg="enabled (--disable-alt-svc)"
curl_headers_msg="no (--enable-headers-api)"
curl_hsts_msg="enabled (--disable-hsts)"
ssl_backends=
curl_h1_msg="enabled (internal)"
@ -3931,6 +3932,25 @@ AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl switch on/off headers-api
dnl
AC_MSG_CHECKING([whether to support headers-api])
AC_ARG_ENABLE(headers-api,
AS_HELP_STRING([--enable-headers-api],[Enable headers-api support])
AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]),
[ case "$enableval" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(USE_HEADERS_API, 1, [enable headers-api])
curl_headers_msg="enabled";
;;
*) AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
dnl only check for HSTS if there's SSL present
if test -n "$SSL_ENABLED"; then
@ -4345,6 +4365,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
RTMP: ${curl_rtmp_msg}
PSL: ${curl_psl_msg}
Alt-svc: ${curl_altsvc_msg}
Headers API: ${curl_headers_msg}
HSTS: ${curl_hsts_msg}
HTTP1: ${curl_h1_msg}
HTTP2: ${curl_h2_msg}

View File

@ -30,6 +30,9 @@ Funny-head: yesyes
#
# Client-side
<client>
<features>
headers-api
</features>
<server>
http
</server>

View File

@ -33,6 +33,9 @@ Connection: close
#
# Client-side
<client>
<features>
headers-api
</features>
<server>
http
</server>

View File

@ -23,6 +23,9 @@ Location: /%TESTNUMBER0002
# Client-side
<client>
<features>
headers-api
</features>
<server>
http
</server>

View File

@ -33,6 +33,7 @@ Silly-thing: yes yes
<features>
proxy
SSL
headers-api
</features>
<server>
http

View File

@ -30,6 +30,7 @@ Location: /%TESTNUMBER0002
<client>
<features>
http
headers-api
</features>
<server>
http

View File

@ -33,6 +33,7 @@ Server: sent-as-trailer
<client>
<features>
http
headers-api
</features>
<server>
http

View File

@ -33,6 +33,9 @@ Set-Cookie: 2cookie=data2;
# Client-side
<client>
<features>
headers-api
</features>
<server>
http
</server>

View File

@ -33,6 +33,7 @@ Silly-thing: yes yes
<features>
proxy
SSL
headers-api
</features>
<server>
http

View File

@ -33,6 +33,9 @@ Set-Cookie: 2cookie=data2;
# Client-side
<client>
<features>
headers-api
</features>
<server>
http
</server>

View File

@ -2933,6 +2933,7 @@ sub setupfeatures {
$feature{"typecheck"} = 1;
$feature{"verbose-strings"} = 1;
$feature{"wakeup"} = 1;
$feature{"headers-api"} = 1;
}

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2022, 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
@ -69,6 +69,9 @@ static const char *disabled[]={
#endif
#ifndef ENABLE_WAKEUP
"wakeup",
#endif
#ifndef USE_HEADERS_API
"headers-api",
#endif
NULL
};