Skip to content

Commit 4ec50bd

Browse files
committed
Update to curl 7.66.0
1 parent 9722097 commit 4ec50bd

File tree

4 files changed

+57
-5
lines changed

4 files changed

+57
-5
lines changed

curl-sys/curl

Submodule curl updated 344 files

curl-sys/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@ pub const CURLVERSION_SECOND: CURLversion = 1;
798798
pub const CURLVERSION_THIRD: CURLversion = 2;
799799
pub const CURLVERSION_FOURTH: CURLversion = 3;
800800
pub const CURLVERSION_FIFTH: CURLversion = 4;
801-
pub const CURLVERSION_NOW: CURLversion = CURLVERSION_FIFTH;
801+
pub const CURLVERSION_SIXTH: CURLversion = 5;
802+
pub const CURLVERSION_NOW: CURLversion = CURLVERSION_SIXTH;
802803

803804
#[repr(C)]
804805
pub struct curl_version_info_data {
@@ -818,6 +819,9 @@ pub struct curl_version_info_data {
818819
pub libssh_version: *const c_char,
819820
pub brotli_ver_num: c_uint,
820821
pub brotli_version: *const c_char,
822+
pub nghttp2_ver_num: c_uint,
823+
pub nghttp2_version: *const c_char,
824+
pub quic_version: *const c_char,
821825
}
822826

823827
pub const CURL_VERSION_IPV6: c_int = 1 << 0;

src/version.rs

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl Version {
3232
/// Returns the libcurl version that this library is currently linked against.
3333
pub fn get() -> Version {
3434
unsafe {
35-
let ptr = curl_sys::curl_version_info(curl_sys::CURLVERSION_FOURTH);
35+
let ptr = curl_sys::curl_version_info(curl_sys::CURLVERSION_NOW);
3636
assert!(!ptr.is_null());
3737
Version { inner: ptr }
3838
}
@@ -245,6 +245,39 @@ impl Version {
245245
}
246246
}
247247
}
248+
249+
/// If available, the version of nghttp2 libcurl is linked against.
250+
pub fn nghttp2_version_num(&self) -> Option<u32> {
251+
unsafe {
252+
if (*self.inner).age >= curl_sys::CURLVERSION_SIXTH {
253+
Some((*self.inner).nghttp2_ver_num)
254+
} else {
255+
None
256+
}
257+
}
258+
}
259+
260+
/// If available, the version of nghttp2 libcurl is linked against.
261+
pub fn nghttp2_version(&self) -> Option<&str> {
262+
unsafe {
263+
if (*self.inner).age >= curl_sys::CURLVERSION_SIXTH {
264+
::opt_str((*self.inner).nghttp2_version)
265+
} else {
266+
None
267+
}
268+
}
269+
}
270+
271+
/// If available, the version of quic libcurl is linked against.
272+
pub fn quic_version(&self) -> Option<&str> {
273+
unsafe {
274+
if (*self.inner).age >= curl_sys::CURLVERSION_SIXTH {
275+
::opt_str((*self.inner).quic_version)
276+
} else {
277+
None
278+
}
279+
}
280+
}
248281
}
249282

250283
impl fmt::Debug for Version {
@@ -286,6 +319,21 @@ impl fmt::Debug for Version {
286319
if let Some(s) = self.libssh_version() {
287320
f.field("libssh_version", &s);
288321
}
322+
if let Some(s) = self.brotli_version_num() {
323+
f.field("brotli_version_num", &format!("{:x}", s));
324+
}
325+
if let Some(s) = self.brotli_version() {
326+
f.field("brotli_version", &s);
327+
}
328+
if let Some(s) = self.nghttp2_version_num() {
329+
f.field("nghttp2_version_num", &format!("{:x}", s));
330+
}
331+
if let Some(s) = self.nghttp2_version() {
332+
f.field("nghttp2_version", &s);
333+
}
334+
if let Some(s) = self.quic_version() {
335+
f.field("quic_version", &s);
336+
}
289337

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

systest/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn main() {
4949
cfg.skip_signededness(|s| s.ends_with("callback") || s.ends_with("function"));
5050

5151
cfg.skip_struct(move |s| {
52-
if version < 60 {
52+
if version < 65 {
5353
match s {
5454
"curl_version_info_data" => return true,
5555
_ => {}
@@ -81,7 +81,7 @@ fn main() {
8181
}
8282
if version < 60 {
8383
match s {
84-
"CURLVERSION_FIFTH" | "CURLVERSION_NOW" => return true,
84+
"CURLVERSION_FIFTH" | "CURLVERSION_SIXTH" | "CURLVERSION_NOW" => return true,
8585
_ => {}
8686
}
8787
}

0 commit comments

Comments
 (0)