87 lines
3.1 KiB
Diff
87 lines
3.1 KiB
Diff
From 9669318f57818f7ae497ef2bdedcd635298e2ce4 Mon Sep 17 00:00:00 2001
|
|
From: Liu Zixian <liuzixian4@huawei.com>
|
|
Date: Tue, 19 Apr 2022 22:28:00 +0800
|
|
Subject: [PATCH] disable http2
|
|
|
|
---
|
|
Cargo.lock | 11 -----------
|
|
src/tools/cargo/Cargo.toml | 2 +-
|
|
src/tools/cargo/src/cargo/core/package.rs | 12 +++---------
|
|
3 files changed, 4 insertions(+), 21 deletions(-)
|
|
|
|
diff --git a/Cargo.lock b/Cargo.lock
|
|
index 8baf4fbd9..79740b777 100644
|
|
--- a/Cargo.lock
|
|
+++ b/Cargo.lock
|
|
@@ -958,7 +958,6 @@ checksum = "d130987e6a6a34fe0889e1083022fa48cd90e6709a84be3fb8dd95801de5af20"
|
|
dependencies = [
|
|
"cc",
|
|
"libc",
|
|
- "libnghttp2-sys",
|
|
"libz-sys",
|
|
"openssl-sys",
|
|
"pkg-config",
|
|
@@ -2008,16 +2007,6 @@ version = "0.1.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
|
|
|
|
-[[package]]
|
|
-name = "libnghttp2-sys"
|
|
-version = "0.1.4+1.41.0"
|
|
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
-checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1"
|
|
-dependencies = [
|
|
- "cc",
|
|
- "libc",
|
|
-]
|
|
-
|
|
[[package]]
|
|
name = "libz-sys"
|
|
version = "1.1.3"
|
|
diff --git a/src/tools/cargo/Cargo.toml b/src/tools/cargo/Cargo.toml
|
|
index fba5257a8..9fe466d6d 100644
|
|
--- a/src/tools/cargo/Cargo.toml
|
|
+++ b/src/tools/cargo/Cargo.toml
|
|
@@ -22,7 +22,7 @@ cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" }
|
|
cargo-util = { path = "crates/cargo-util", version = "0.1.2" }
|
|
crates-io = { path = "crates/crates-io", version = "0.34.0" }
|
|
crossbeam-utils = "0.8"
|
|
-curl = { version = "0.4.41", features = ["http2"] }
|
|
+curl = { version = "0.4.41", features = [] }
|
|
curl-sys = "0.4.50"
|
|
env_logger = "0.9.0"
|
|
pretty_env_logger = { version = "0.4", optional = true }
|
|
diff --git a/src/tools/cargo/src/cargo/core/package.rs b/src/tools/cargo/src/cargo/core/package.rs
|
|
index 0ebe0277e..1b3fc1ee1 100644
|
|
--- a/src/tools/cargo/src/cargo/core/package.rs
|
|
+++ b/src/tools/cargo/src/cargo/core/package.rs
|
|
@@ -412,14 +412,8 @@ impl<'cfg> PackageSet<'cfg> {
|
|
// Also note that pipelining is disabled as curl authors have indicated
|
|
// that it's buggy, and we've empirically seen that it's buggy with HTTP
|
|
// proxies.
|
|
- let mut multi = Multi::new();
|
|
- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true);
|
|
- multi
|
|
- .pipelining(false, multiplexing)
|
|
- .with_context(|| "failed to enable multiplexing/pipelining in curl")?;
|
|
-
|
|
- // let's not flood crates.io with connections
|
|
- multi.set_max_host_connections(2)?;
|
|
+ let multi = Multi::new();
|
|
+ let multiplexing = false;
|
|
|
|
Ok(PackageSet {
|
|
packages: package_ids
|
|
@@ -648,7 +642,7 @@ impl<'cfg> PackageSet<'cfg> {
|
|
macro_rules! try_old_curl {
|
|
($e:expr, $msg:expr) => {
|
|
let result = $e;
|
|
- if cfg!(target_os = "macos") {
|
|
+ if cfg!(any(target_os = "linux", target_os = "macos")) {
|
|
if let Err(e) = result {
|
|
warn!("ignoring libcurl {} error: {}", $msg, e);
|
|
}
|
|
--
|
|
2.35.1
|
|
|