diff --git a/Cargo.toml b/Cargo.toml index d8d8bf5c8b3..46b26fbe098 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,8 +24,8 @@ bytesize = "1.0" crates-io = { path = "src/crates-io", version = "0.24" } crossbeam-utils = "0.6" crypto-hash = "0.3.1" -curl = { version = "0.4.19", features = ['http2'] } -curl-sys = "0.4.15" +curl = { version = "0.4.21", features = ['http2'] } +curl-sys = "0.4.18" env_logger = "0.6.0" pretty_env_logger = { version = "0.3", optional = true } failure = "0.1.5" diff --git a/src/cargo/util/network.rs b/src/cargo/util/network.rs index 310f24a6550..2873dea253b 100644 --- a/src/cargo/util/network.rs +++ b/src/cargo/util/network.rs @@ -50,6 +50,7 @@ fn maybe_spurious(err: &Error) -> bool { || curl_err.is_couldnt_resolve_host() || curl_err.is_operation_timedout() || curl_err.is_recv_error() + || curl_err.is_http2_stream_error() { return true; } @@ -125,3 +126,10 @@ fn with_retry_finds_nested_spurious_errors() { let result = with_retry(&config, || results.pop().unwrap()); assert_eq!(result.unwrap(), ()) } + +#[test] +fn curle_http2_stream_is_spurious() { + let code = curl_sys::CURLE_HTTP2_STREAM; + let err = curl::Error::new(code); + assert!(maybe_spurious(&err.into())); +}