]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl:getparameter return error for --http3 if libcurl doesn't support
authorDaniel Stenberg <daniel@haxx.se>
Sun, 5 Jan 2020 16:12:03 +0000 (17:12 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 5 Jan 2020 20:24:17 +0000 (21:24 +0100)
Closes #4785

src/tool_getparam.c

index ced45319271e5abcbd0fba1c3f64a6a6cc8c1e26..8df6e5e24b65a6ba6b7b4d5efa95b0f449d1697e 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, 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
@@ -1209,7 +1209,10 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
         break;
       case '4': /* --http3 */
         /* HTTP version 3 go over QUIC - at once */
-        config->httpversion = CURL_HTTP_VERSION_3;
+        if(curlinfo->features & CURL_VERSION_HTTP3)
+          config->httpversion = CURL_HTTP_VERSION_3;
+        else
+          return PARAM_LIBCURL_DOESNT_SUPPORT;
         break;
       case '9':
         /* Allow HTTP/0.9 responses! */