Update to curl-sys 0.4.60

This commit is contained in:
jcamiel 2023-02-21 22:02:11 +01:00
parent 5939501adb
commit 498fca1da1
No known key found for this signature in database
GPG Key ID: 07FF11CFD55356CC
4 changed files with 14 additions and 8 deletions

5
Cargo.lock generated
View File

@ -247,9 +247,9 @@ dependencies = [
[[package]]
name = "curl-sys"
version = "0.4.59+curl-7.86.0"
version = "0.4.60+curl-7.88.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6cfce34829f448b08f55b7db6d0009e23e2e86a34e8c2b366269bf5799b4a407"
checksum = "717abe2cb465a5da6ce06617388a3980c9a2844196734bec8ccb8e575250f13f"
dependencies = [
"cc",
"libc",
@ -504,6 +504,7 @@ dependencies = [
"clap",
"colored",
"curl",
"curl-sys",
"encoding",
"float-cmp",
"glob",

View File

@ -47,7 +47,7 @@ get_crate_latest_version() {
# get crate latest version
crate_object=$(curl -kLs "${crate_url}" || true)
crate_max_stable_version=$(echo "${crate_object}" | (jq -r .crate.max_stable_version 2>/dev/null || true))
last_version=$(echo "${crate_max_stable_version}" | (grep --extended-regexp "^[0-9].*.[0-9].*.[0-9]$" || true))
last_version=$(echo "${crate_max_stable_version}" | (grep --extended-regexp --only-matching "^[0-9]*\.[0-9]*\.[0-9]*" || true))
echo "${last_version}"
}

View File

@ -24,6 +24,7 @@ chrono = { version = "0.4.23", default-features = false, features = ["clock"] }
clap = { version = "4.1.6", features = ["cargo", "string", "wrap_help"] }
colored = "2.0.0"
curl = "0.4.44"
curl-sys = "0.4.60"
encoding = "0.2.33"
float-cmp = "0.9.0"
glob = "0.3.1"

View File

@ -16,6 +16,7 @@
*
*/
use regex::Regex;
use std::default::Default;
use std::time::Duration;
@ -846,14 +847,17 @@ fn test_connect_timeout() {
{
eprintln!("description={description}");
// TODO: remove the 7 / "Couldn't connect to server" case
// On Linux/Windows libcurl version, the correct error message
// is 28 / "Connection timeout" | "Connection timed out"
// On macOS <= 11.6.4, the built-in libcurl use
// 7 / "Couldn't connect to server" errors. On the GitHub CI, macOS images are 11.6.4.
// On Linux/Windows libcurl version, the correct error message is:
// `CURLE_OPERATION_TIMEDOUT` (28) / "Connection timeout" | "Connection timed out"
// On macOS <= 11.6.4, the built-in libcurl is:
// `CURLE_COULDNT_CONNECT` (7) / "Couldn't connect to server" errors.
// On the GitHub CI, macOS images are 11.6.4.
// So we keep this code until a newer macOS image is used in the GitHub actions.
assert!(code == 7 || code == 28);
let re = Regex::new(r"^Failed to connect to.*: Timeout was reached$").unwrap();
assert!(
description.starts_with("Couldn't connect to server")
re.is_match(&description)
|| description.starts_with("Couldn't connect to server")
|| description.starts_with("Connection timed out")
|| description.starts_with("Connection timeout")
);