diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-08-07 14:17:48 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-08-08 08:17:24 +0200 |
commit | 026840e35c7359c23741afe633bd3ab4b121c4ed (patch) | |
tree | fc931e91538dfd07ecc6653e897a4491cfb8cc3f /lib | |
parent | 317076876a056d26175e07e21bd32f9889bf8ea2 (diff) |
CURLOPT_HTTP_VERSION: seting this to 3 forces HTTP/3 use directly
Even though it cannot fall-back to a lower HTTP version automatically. The
safer way to upgrade remains via CURLOPT_ALTSVC.
CURLOPT_H3 no longer has any bits that do anything and might be removed
before we remove the experimental label.
Updated the curl tool accordingly to use "--http3".
Closes #4197
Diffstat (limited to 'lib')
-rw-r--r-- | lib/http.c | 6 | ||||
-rw-r--r-- | lib/setopt.c | 8 | ||||
-rw-r--r-- | lib/urldata.h | 1 |
3 files changed, 9 insertions, 6 deletions
diff --git a/lib/http.c b/lib/http.c index cfa7093b2..546c34aad 100644 --- a/lib/http.c +++ b/lib/http.c @@ -169,10 +169,10 @@ static CURLcode http_setup_conn(struct connectdata *conn) Curl_mime_initpart(&http->form, conn->data); data->req.protop = http; - if(data->set.h3opts & CURLH3_DIRECT) { + if(data->set.httpversion == CURL_HTTP_VERSION_3) { if(conn->handler->flags & PROTOPT_SSL) - /* Only go h3-direct on HTTPS URLs. It needs a UDP socket and does the - QUIC dance. */ + /* Only go HTTP/3 directly on HTTPS URLs. It needs a UDP socket and does + the QUIC dance. */ conn->transport = TRNSPRT_QUIC; else { failf(data, "HTTP/3 requested for non-HTTPS URL"); diff --git a/lib/setopt.c b/lib/setopt.c index 91251bd7b..1ad721131 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -809,6 +809,11 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) arg = va_arg(param, long); if(arg < CURL_HTTP_VERSION_NONE) return CURLE_BAD_FUNCTION_ARGUMENT; +#ifdef ENABLE_QUIC + if(arg == CURL_HTTP_VERSION_3) + ; + else +#endif #ifndef USE_NGHTTP2 if(arg >= CURL_HTTP_VERSION_2) return CURLE_UNSUPPORTED_PROTOCOL; @@ -2752,8 +2757,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) #endif case CURLOPT_H3: #ifdef ENABLE_QUIC - arg = va_arg(param, long); - data->set.h3opts = arg; + /* not use anymore */ #else return CURLE_NOT_BUILT_IN; #endif diff --git a/lib/urldata.h b/lib/urldata.h index fec3f755a..395664d04 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -1680,7 +1680,6 @@ struct UserDefined { CURLU *uh; /* URL handle for the current parsed URL */ void *trailer_data; /* pointer to pass to trailer data callback */ curl_trailer_callback trailer_callback; /* trailing data callback */ - long h3opts; /* the CURLOPT_H3 bitmask */ bit is_fread_set:1; /* has read callback been set to non-NULL? */ bit is_fwrite_set:1; /* has write callback been set to non-NULL? */ bit free_referer:1; /* set TRUE if 'referer' points to a string we |