From 10a1d06dceb43ecd868714872074a8aa8ee8d34e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 11 Jun 2020 13:26:14 +1000 Subject: [PATCH] use vendored hyper for panic fix --- rslib/Cargo.toml | 3 +++ rslib/src/err.rs | 3 +++ rspy/Cargo.toml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/rslib/Cargo.toml b/rslib/Cargo.toml index 0d7b7a229..6e94bf8ca 100644 --- a/rslib/Cargo.toml +++ b/rslib/Cargo.toml @@ -71,3 +71,6 @@ fluent-syntax = "0.9.2" [dev-dependencies] env_logger = "0.7.1" +[patch.crates-io] +hyper = { git = "https://github.com/ankitects/hyper.git", branch = "gai-cancel-panic" } + diff --git a/rslib/src/err.rs b/rslib/src/err.rs index 5e07264ab..796aa48e3 100644 --- a/rslib/src/err.rs +++ b/rslib/src/err.rs @@ -243,6 +243,9 @@ fn error_for_status_code(info: String, code: StatusCode) -> AnkiError { } fn guess_reqwest_error(info: String) -> AnkiError { + if info.contains("dns error: cancelled") { + return AnkiError::Interrupted; + } let kind = if info.contains("unreachable") || info.contains("dns") { NetworkErrorKind::Offline } else { diff --git a/rspy/Cargo.toml b/rspy/Cargo.toml index 6de18f71a..e5a591c6b 100644 --- a/rspy/Cargo.toml +++ b/rspy/Cargo.toml @@ -18,3 +18,6 @@ features = ["extension-module"] [lib] name = "ankirspy" crate-type = ["cdylib"] + +[patch.crates-io] +hyper = { git = "https://github.com/ankitects/hyper.git", branch = "gai-cancel-panic" }