Skip to content

Commit 8ccc410

Browse files
jonhooalexcrichton
andauthored
Bump curl to 7.77.0 (#396)
* Bump curl to 7.77.0 * Include more files to build * Bump curl-sys version * See all failures on CI * Update version structure/constants * Fix macOS build * Fix link on macOS * Bump curl crate version Co-authored-by: Alex Crichton <[email protected]>
1 parent 937da74 commit 8ccc410

File tree

7 files changed

+76
-7
lines changed

7 files changed

+76
-7
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "curl"
3-
version = "0.4.37"
3+
version = "0.4.38"
44
authors = ["Alex Crichton <[email protected]>"]
55
license = "MIT"
66
repository = "https://github.com/alexcrichton/curl-rust"
@@ -18,7 +18,7 @@ appveyor = { repository = "alexcrichton/curl-rust" }
1818

1919
[dependencies]
2020
libc = "0.2.42"
21-
curl-sys = { path = "curl-sys", version = "0.4.43", default-features = false }
21+
curl-sys = { path = "curl-sys", version = "0.4.44", default-features = false }
2222
socket2 = "0.4.0"
2323

2424
# Unix platforms use OpenSSL for now to provide SSL functionality

curl-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "curl-sys"
3-
version = "0.4.43+curl-7.76.0"
3+
version = "0.4.44+curl-7.77.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
links = "curl"
66
build = "build.rs"

curl-sys/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ fn main() {
128128
.define("OS", "\"unknown\"") // TODO
129129
.define("HAVE_ZLIB_H", None)
130130
.define("HAVE_LIBZ", None)
131+
.define("HAVE_BOOL_T", None)
132+
.define("HAVE_STDBOOL_H", None)
131133
.file("curl/lib/asyn-thread.c")
132134
.file("curl/lib/altsvc.c")
133135
.file("curl/lib/base64.c")
@@ -156,6 +158,7 @@ fn main() {
156158
.file("curl/lib/hostcheck.c")
157159
.file("curl/lib/hostip.c")
158160
.file("curl/lib/hostip6.c")
161+
.file("curl/lib/hsts.c")
159162
.file("curl/lib/http.c")
160163
.file("curl/lib/http2.c")
161164
.file("curl/lib/http_chunks.c")
@@ -383,6 +386,7 @@ fn main() {
383386
if target.contains("-apple-") {
384387
println!("cargo:rustc-link-lib=framework=Security");
385388
println!("cargo:rustc-link-lib=framework=CoreFoundation");
389+
println!("cargo:rustc-link-lib=framework=SystemConfiguration");
386390
}
387391
}
388392

curl-sys/curl

Submodule curl updated 349 files

curl-sys/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,8 @@ pub const CURLVERSION_SIXTH: CURLversion = 5;
830830
pub const CURLVERSION_SEVENTH: CURLversion = 6;
831831
pub const CURLVERSION_EIGHTH: CURLversion = 7;
832832
pub const CURLVERSION_NINTH: CURLversion = 8;
833-
pub const CURLVERSION_NOW: CURLversion = CURLVERSION_NINTH;
833+
pub const CURLVERSION_TENTH: CURLversion = 9;
834+
pub const CURLVERSION_NOW: CURLversion = CURLVERSION_TENTH;
834835

835836
#[repr(C)]
836837
pub struct curl_version_info_data {
@@ -858,6 +859,7 @@ pub struct curl_version_info_data {
858859
pub zstd_ver_num: c_uint,
859860
pub zstd_version: *const c_char,
860861
pub hyper_version: *const c_char,
862+
pub gsasl_version: *const c_char,
861863
}
862864

863865
pub const CURL_VERSION_IPV6: c_int = 1 << 0;
@@ -879,7 +881,12 @@ pub const CURL_VERSION_NTLM_WB: c_int = 1 << 15;
879881
pub const CURL_VERSION_HTTP2: c_int = 1 << 16;
880882
pub const CURL_VERSION_UNIX_SOCKETS: c_int = 1 << 19;
881883
pub const CURL_VERSION_BROTLI: c_int = 1 << 23;
884+
pub const CURL_VERSION_ALTSVC: c_int = 1 << 24;
882885
pub const CURL_VERSION_HTTP3: c_int = 1 << 25;
886+
pub const CURL_VERSION_ZSTD: c_int = 1 << 26;
887+
pub const CURL_VERSION_UNICODE: c_int = 1 << 27;
888+
pub const CURL_VERSION_HSTS: c_int = 1 << 28;
889+
pub const CURL_VERSION_GSASL: c_int = 1 << 29;
883890

884891
pub const CURLPAUSE_RECV: c_int = 1 << 0;
885892
pub const CURLPAUSE_RECV_CONT: c_int = 0;

src/version.rs

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,31 @@ impl Version {
151151
self.flag(curl_sys::CURL_VERSION_BROTLI)
152152
}
153153

154+
/// Returns whether libcurl was built with support for Alt-Svc.
155+
pub fn feature_altsvc(&self) -> bool {
156+
self.flag(curl_sys::CURL_VERSION_ALTSVC)
157+
}
158+
159+
/// Returns whether libcurl was built with support for zstd
160+
pub fn feature_zstd(&self) -> bool {
161+
self.flag(curl_sys::CURL_VERSION_ZSTD)
162+
}
163+
164+
/// Returns whether libcurl was built with support for unicode
165+
pub fn feature_unicode(&self) -> bool {
166+
self.flag(curl_sys::CURL_VERSION_UNICODE)
167+
}
168+
169+
/// Returns whether libcurl was built with support for hsts
170+
pub fn feature_hsts(&self) -> bool {
171+
self.flag(curl_sys::CURL_VERSION_HSTS)
172+
}
173+
174+
/// Returns whether libcurl was built with support for gsasl
175+
pub fn feature_gsasl(&self) -> bool {
176+
self.flag(curl_sys::CURL_VERSION_GSASL)
177+
}
178+
154179
fn flag(&self, flag: c_int) -> bool {
155180
unsafe { (*self.inner).features & flag != 0 }
156181
}
@@ -345,6 +370,17 @@ impl Version {
345370
}
346371
}
347372
}
373+
374+
/// If available, the human readable version of hyper
375+
pub fn gsasl_version(&self) -> Option<&str> {
376+
unsafe {
377+
if (*self.inner).age >= curl_sys::CURLVERSION_TENTH {
378+
crate::opt_str((*self.inner).gsasl_version)
379+
} else {
380+
None
381+
}
382+
}
383+
}
348384
}
349385

350386
impl fmt::Debug for Version {
@@ -371,7 +407,14 @@ impl fmt::Debug for Version {
371407
.field(
372408
"feature_unix_domain_socket",
373409
&self.feature_unix_domain_socket(),
374-
);
410+
)
411+
.field("feature_altsvc", &self.feature_altsvc())
412+
.field("feature_zstd", &self.feature_zstd())
413+
.field("feature_unicode", &self.feature_unicode())
414+
.field("feature_http3", &self.feature_http3())
415+
.field("feature_http2", &self.feature_http2())
416+
.field("feature_gsasl", &self.feature_gsasl())
417+
.field("feature_brotli", &self.feature_brotli());
375418

376419
if let Some(s) = self.ssl_version() {
377420
f.field("ssl_version", &s);
@@ -421,6 +464,9 @@ impl fmt::Debug for Version {
421464
if let Some(s) = self.hyper_version() {
422465
f.field("hyper_version", &s);
423466
}
467+
if let Some(s) = self.gsasl_version() {
468+
f.field("gsasl_version", &s);
469+
}
424470

425471
f.field("protocols", &self.protocols().collect::<Vec<_>>());
426472

systest/build.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,21 @@ fn main() {
6464
});
6565

6666
cfg.skip_const(move |s| {
67+
if version < 77 {
68+
match s {
69+
"CURLVERSION_TENTH"
70+
| "CURLVERSION_NOW"
71+
| "CURL_VERSION_ALTSVC"
72+
| "CURL_VERSION_ZSTD"
73+
| "CURL_VERSION_UNICODE"
74+
| "CURL_VERSION_HSTS"
75+
| "CURL_VERSION_GSASL" => return true,
76+
_ => {}
77+
}
78+
}
6779
if version < 75 {
6880
match s {
69-
"CURLVERSION_NINTH" | "CURLVERSION_NOW" => return true,
81+
"CURLVERSION_NINTH" => return true,
7082
_ => {}
7183
}
7284
}

0 commit comments

Comments
 (0)