]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
examples/http3.c: use CURL_HTTP_VERSION_3
authorDaniel Stenberg <daniel@haxx.se>
Mon, 27 Feb 2023 09:12:59 +0000 (10:12 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 27 Feb 2023 14:11:13 +0000 (15:11 +0100)
and update the comment

Closes #10619

docs/examples/http3.c

index 7e30845a55ff9c60d2a5c5f7220cefcaa66f4733..900e119208537580c1d42ae11b6b63e806fc0452 100644 (file)
@@ -37,11 +37,9 @@ int main(void)
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
 
-    /* Forcing HTTP/3 will make the connection fail if the server is not
-       accessible over QUIC + HTTP/3 on the given host and port.
-       Consider using CURLOPT_ALTSVC instead! */
+    /* Use HTTP/3 but fallback to earlier HTTP if necessary */
     curl_easy_setopt(curl, CURLOPT_HTTP_VERSION,
-                     (long)CURL_HTTP_VERSION_3ONLY);
+                     (long)CURL_HTTP_VERSION_3);
 
     /* Perform the request, res will get the return code */
     res = curl_easy_perform(curl);