Skip to content
Permalink
Browse files

curl.h: add CURL_HTTP_VERSION_3 to the version enum

It can't be set for CURLOPT_HTTP_VERSION, but it can be extracted with
CURLINFO_HTTP_VERSION.
  • Loading branch information...
bagder committed Aug 7, 2019
1 parent 1f145b0 commit fd00e14adb11ee1ec4f39e01ce25041c7f4316b5
Showing with 8 additions and 2 deletions.
  1. +1 −0 docs/libcurl/symbols-in-versions
  2. +3 −1 include/curl/curl.h
  3. +3 −0 lib/getinfo.c
  4. +1 −1 lib/url.c
@@ -834,6 +834,7 @@ CURL_HTTP_VERSION_2 7.43.0
CURL_HTTP_VERSION_2TLS 7.47.0
CURL_HTTP_VERSION_2_0 7.33.0
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 7.49.0
CURL_HTTP_VERSION_3 7.66.0
CURL_HTTP_VERSION_NONE 7.9.1
CURL_IPRESOLVE_V4 7.10.8
CURL_IPRESOLVE_V6 7.10.8
@@ -1985,7 +1985,9 @@ enum {
CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
Upgrade */

CURL_HTTP_VERSION_3 = 30, /* This cannot be set with CURLOPT_HTTP_VERSION,
use CURLOPT_H3 and/or CURLOPT_ALTSVC to enable
HTTP/3 */
CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
};

@@ -235,6 +235,9 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info,
case 20:
*param_longp = CURL_HTTP_VERSION_2_0;
break;
case 30:
*param_longp = CURL_HTTP_VERSION_3;
break;
default:
*param_longp = CURL_HTTP_VERSION_NONE;
break;
@@ -3201,7 +3201,7 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data,
break;
case ALPN_h3:
conn->transport = TRNSPRT_QUIC;
conn->httpversion = CURL_HTTP_VERSION_LAST; /* for the moment */
conn->httpversion = CURL_HTTP_VERSION_3;
break;
default: /* shouldn't be possible */
break;

0 comments on commit fd00e14

Please sign in to comment.
You can’t perform that action at this time.