Skip to content

Commit f2ea95a

Browse files
committed
Auto merge of #6861 - fluffysquirrels:http2-stream-error-spurious, r=alexcrichton
Treat HTTP/2 stream errors as spurious network errors. Closes #6788.
2 parents 6dce2aa + cc29c2b commit f2ea95a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ bytesize = "1.0"
2424
crates-io = { path = "src/crates-io", version = "0.25" }
2525
crossbeam-utils = "0.6"
2626
crypto-hash = "0.3.1"
27-
curl = { version = "0.4.19", features = ['http2'] }
28-
curl-sys = "0.4.15"
27+
curl = { version = "0.4.21", features = ['http2'] }
28+
curl-sys = "0.4.18"
2929
env_logger = "0.6.0"
3030
pretty_env_logger = { version = "0.3", optional = true }
3131
failure = "0.1.5"

src/cargo/util/network.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ fn maybe_spurious(err: &Error) -> bool {
5050
|| curl_err.is_couldnt_resolve_host()
5151
|| curl_err.is_operation_timedout()
5252
|| curl_err.is_recv_error()
53+
|| curl_err.is_http2_stream_error()
5354
{
5455
return true;
5556
}
@@ -125,3 +126,10 @@ fn with_retry_finds_nested_spurious_errors() {
125126
let result = with_retry(&config, || results.pop().unwrap());
126127
assert_eq!(result.unwrap(), ())
127128
}
129+
130+
#[test]
131+
fn curle_http2_stream_is_spurious() {
132+
let code = curl_sys::CURLE_HTTP2_STREAM;
133+
let err = curl::Error::new(code);
134+
assert!(maybe_spurious(&err.into()));
135+
}

0 commit comments

Comments
 (0)