mirror of
https://github.com/curl/curl.git
synced 2025-09-10 14:12:41 +03:00
curl.h: switch CURL_HTTP_VERSION*
enums to long constants
It fixes tests 1539, and 2402, 2404 (for non-Secure Transport), on macOS with the gcc compiler. Also unignore these tests in GHA/macos for non-secure transport. Ref:c349bd668c
#14097 (issue 15.) Ref:7b0240c077
#16539 Ref:2ec00372a1
#16482 Closes #16580
This commit is contained in:
parent
f9ec5d89cb
commit
fd54bed51a
4
.github/workflows/macos.yml
vendored
4
.github/workflows/macos.yml
vendored
|
@ -315,7 +315,7 @@ jobs:
|
||||||
if [ -z '${{ matrix.build.torture }}' ]; then
|
if [ -z '${{ matrix.build.torture }}' ]; then
|
||||||
TFLAGS+=' ~2037 ~2041' # flaky
|
TFLAGS+=' ~2037 ~2041' # flaky
|
||||||
if [[ '${{ matrix.compiler }}' = 'gcc'* ]]; then
|
if [[ '${{ matrix.compiler }}' = 'gcc'* ]]; then
|
||||||
TFLAGS+=' ~1156 ~1539' # HTTP Content-Range, Content-Length
|
TFLAGS+=' ~1156' # HTTP Content-Range
|
||||||
if [[ -n '${{ matrix.build.configure }}' || \
|
if [[ -n '${{ matrix.build.configure }}' || \
|
||||||
'${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then
|
'${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then
|
||||||
TFLAGS+=' ~2100' # 2100:'HTTP GET using DoH' https://github.com/curl/curl/actions/runs/9942146678/job/27462937524#step:15:5059
|
TFLAGS+=' ~2100' # 2100:'HTTP GET using DoH' https://github.com/curl/curl/actions/runs/9942146678/job/27462937524#step:15:5059
|
||||||
|
@ -323,8 +323,6 @@ jobs:
|
||||||
if [[ '${{ matrix.build.configure }}' = *'--with-secure-transport'* || \
|
if [[ '${{ matrix.build.configure }}' = *'--with-secure-transport'* || \
|
||||||
'${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then
|
'${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then
|
||||||
TFLAGS+=' ~HTTP/2' # 2400 2401 2402 2403 2404 2406, Secure Transport + nghttp2
|
TFLAGS+=' ~HTTP/2' # 2400 2401 2402 2403 2404 2406, Secure Transport + nghttp2
|
||||||
else
|
|
||||||
TFLAGS+=' ~2402 ~2404' # non-Secure Transport + nghttp2
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ '${{ matrix.build.configure }}' = *'--with-secure-transport'* || \
|
if [[ '${{ matrix.build.configure }}' = *'--with-secure-transport'* || \
|
||||||
|
|
|
@ -2293,26 +2293,25 @@ typedef enum {
|
||||||
/* Convenient "aliases" */
|
/* Convenient "aliases" */
|
||||||
#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
|
#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
|
||||||
|
|
||||||
/* These enums are for use with the CURLOPT_HTTP_VERSION option. */
|
/* These constants are for use with the CURLOPT_HTTP_VERSION option. */
|
||||||
enum {
|
#define CURL_HTTP_VERSION_NONE 0L /* setting this means we do not care, and
|
||||||
CURL_HTTP_VERSION_NONE, /* setting this means we do not care, and that we
|
that we would like the library to choose
|
||||||
would like the library to choose the best
|
the best possible for us! */
|
||||||
possible for us! */
|
#define CURL_HTTP_VERSION_1_0 1L /* please use HTTP 1.0 in the request */
|
||||||
CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
|
#define CURL_HTTP_VERSION_1_1 2L /* please use HTTP 1.1 in the request */
|
||||||
CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
|
#define CURL_HTTP_VERSION_2_0 3L /* please use HTTP 2 in the request */
|
||||||
CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */
|
#define CURL_HTTP_VERSION_2TLS 4L /* use version 2 for HTTPS, version 1.1 for
|
||||||
CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
|
HTTP */
|
||||||
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
|
#define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without
|
||||||
Upgrade */
|
HTTP/1.1 Upgrade */
|
||||||
CURL_HTTP_VERSION_3 = 30, /* Use HTTP/3, fallback to HTTP/2 or HTTP/1 if
|
#define CURL_HTTP_VERSION_3 30L /* Use HTTP/3, fallback to HTTP/2 or
|
||||||
needed. For HTTPS only. For HTTP, this option
|
HTTP/1 if needed. For HTTPS only. For
|
||||||
makes libcurl return error. */
|
HTTP, this option makes libcurl
|
||||||
CURL_HTTP_VERSION_3ONLY = 31, /* Use HTTP/3 without fallback. For HTTPS
|
|
||||||
only. For HTTP, this makes libcurl
|
|
||||||
return error. */
|
return error. */
|
||||||
|
#define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For
|
||||||
CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
|
HTTPS only. For HTTP, this makes
|
||||||
};
|
libcurl return error. */
|
||||||
|
#define CURL_HTTP_VERSION_LAST 32L /* *ILLEGAL* http version */
|
||||||
|
|
||||||
/* Convenience definition simple because the name of the version is HTTP/2 and
|
/* Convenience definition simple because the name of the version is HTTP/2 and
|
||||||
not 2.0. The 2_0 version of the enum name was set while the version was
|
not 2.0. The 2_0 version of the enum name was set while the version was
|
||||||
|
|
|
@ -70,7 +70,7 @@ CURLcode test(char *URL)
|
||||||
easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||||
easy_setopt(curl, CURLOPT_POST, 1L);
|
easy_setopt(curl, CURLOPT_POST, 1L);
|
||||||
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
easy_setopt(curl, CURLOPT_HTTP_VERSION, (long)CURL_HTTP_VERSION_1_1);
|
easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
|
||||||
easy_setopt(curl, CURLOPT_URL, URL);
|
easy_setopt(curl, CURLOPT_URL, URL);
|
||||||
easy_setopt(curl, CURLOPT_READDATA, NULL);
|
easy_setopt(curl, CURLOPT_READDATA, NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user