Skip to content

Commit 16e7f87

Browse files
authored
Fix semantic of HttpVersion::V3 for libcurl >= 7.88.0 (#521)
CURL_HTTP_VERSION_3, introduced in curl 7.66.0, has changed with curl 7.88.0. Prior 7.88.0, CURL_HTTP_VERSION_3 implies no fallback if error; since 7.88.0, CURL_HTTP_VERSION_3 can fallback to HTTP/1 or HTTP/2. There is a new flag CURL_HTTP_VERSION_3_ONLY that doesn't fallback. See curl/curl#10264.
1 parent ff6ad21 commit 16e7f87

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

curl-sys/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ pub const CURL_HTTP_VERSION_2TLS: c_int = 4;
660660
/// Please use HTTP 2 without HTTP/1.1 Upgrade
661661
/// (Added in CURL 7.49.0)
662662
pub const CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE: c_int = 5;
663-
/// Makes use of explicit HTTP/3 without fallback.
663+
/// Use HTTP/3, fallback to HTTP/2 or HTTP/1 if needed.
664664
/// (Added in CURL 7.66.0)
665665
pub const CURL_HTTP_VERSION_3: c_int = 30;
666666

src/easy/handler.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,11 @@ pub enum HttpVersion {
453453
V2PriorKnowledge = curl_sys::CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE as isize,
454454

455455
/// Setting this value will make libcurl attempt to use HTTP/3 directly to
456-
/// server given in the URL. Note that this cannot gracefully downgrade to
457-
/// earlier HTTP version if the server doesn't support HTTP/3.
456+
/// server given in the URL but fallback to earlier HTTP versions if the HTTP/3
457+
/// connection establishment fails.
458458
///
459-
/// For more reliably upgrading to HTTP/3, set the preferred version to
460-
/// something lower and let the server announce its HTTP/3 support via
461-
/// Alt-Svc:.
459+
/// Note: the meaning of this settings depends on the linked libcurl.
460+
/// For CURL < 7.88.0, there is no fallback if HTTP/3 connection fails.
462461
///
463462
/// (Added in CURL 7.66.0)
464463
V3 = curl_sys::CURL_HTTP_VERSION_3 as isize,

0 commit comments

Comments
 (0)