Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix semantic of HttpVersion::V3 for libcurl >= 7.88.0 #521

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion curl-sys/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ pub const CURL_HTTP_VERSION_2TLS: c_int = 4;
/// Please use HTTP 2 without HTTP/1.1 Upgrade
/// (Added in CURL 7.49.0)
pub const CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE: c_int = 5;
/// Makes use of explicit HTTP/3 without fallback.
/// Use HTTP/3, fallback to HTTP/2 or HTTP/1 if needed.
/// (Added in CURL 7.66.0)
pub const CURL_HTTP_VERSION_3: c_int = 30;

Expand Down
9 changes: 4 additions & 5 deletions src/easy/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,11 @@ pub enum HttpVersion {
V2PriorKnowledge = curl_sys::CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE as isize,

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