From 94456ee4b15593888af9b04d51d40b36858971c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Mon, 27 Jun 2022 09:42:27 +0200 Subject: [PATCH] http: move TLS helper to client feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it's only used there and pulls in hyper and tokio, which we don't want/need in http-helpers. Signed-off-by: Fabian Grünbichler --- proxmox-http/Cargo.toml | 6 +++--- proxmox-http/src/client/connector.rs | 2 +- proxmox-http/src/client/mod.rs | 2 ++ proxmox-http/src/{ => client}/tls.rs | 0 proxmox-http/src/lib.rs | 3 --- 5 files changed, 6 insertions(+), 7 deletions(-) rename proxmox-http/src/{ => client}/tls.rs (100%) diff --git a/proxmox-http/Cargo.toml b/proxmox-http/Cargo.toml index 7c222102..f3a554b2 100644 --- a/proxmox-http/Cargo.toml +++ b/proxmox-http/Cargo.toml @@ -16,7 +16,7 @@ anyhow = "1.0" base64 = { version = "0.13", optional = true } futures = { version = "0.3", optional = true } http = { version = "0.2", optional = true } -hyper = { version = "0.14", features = [ "full" ], optional = true } +hyper = { version = "0.14", default_features = false, optional = true } openssl = { version = "0.10", optional = true } serde_json = { version = "1.0", optional = true } tokio = { version = "1.0", features = [], optional = true } @@ -30,8 +30,8 @@ proxmox-lang = { path = "../proxmox-lang", optional = true, version = "1.1" } [features] default = [] -client = [ "futures", "http-helpers", "openssl" ] -http-helpers = [ "base64", "http", "hyper", "serde_json", "tokio/io-util", "tokio-openssl", "proxmox-sys", "url" ] +client = [ "futures", "http-helpers", "hyper/full", "openssl", "tokio/io-util", "tokio-openssl" ] +http-helpers = [ "base64", "http", "proxmox-sys", "serde_json", "url" ] websocket = [ "base64", "futures", diff --git a/proxmox-http/src/client/connector.rs b/proxmox-http/src/client/connector.rs index ddf77410..a01dbca4 100644 --- a/proxmox-http/src/client/connector.rs +++ b/proxmox-http/src/client/connector.rs @@ -15,9 +15,9 @@ use tokio_openssl::SslStream; use proxmox_sys::linux::socket::set_tcp_keepalive; use crate::proxy_config::ProxyConfig; -use crate::tls::MaybeTlsStream; use crate::uri::build_authority; +use super::tls::MaybeTlsStream; use super::{RateLimitedStream, ShareableRateLimit}; type SharedRateLimit = Arc; diff --git a/proxmox-http/src/client/mod.rs b/proxmox-http/src/client/mod.rs index 2f365fc7..e578be2d 100644 --- a/proxmox-http/src/client/mod.rs +++ b/proxmox-http/src/client/mod.rs @@ -14,3 +14,5 @@ pub use connector::HttpsConnector; mod simple; pub use simple::SimpleHttp; pub use simple::SimpleHttpOptions; + +pub mod tls; diff --git a/proxmox-http/src/tls.rs b/proxmox-http/src/client/tls.rs similarity index 100% rename from proxmox-http/src/tls.rs rename to proxmox-http/src/client/tls.rs diff --git a/proxmox-http/src/lib.rs b/proxmox-http/src/lib.rs index 5f4bb643..9a8a6350 100644 --- a/proxmox-http/src/lib.rs +++ b/proxmox-http/src/lib.rs @@ -3,9 +3,6 @@ #[cfg(feature = "websocket")] pub mod websocket; -#[cfg(feature = "http-helpers")] -pub mod tls; - #[cfg(feature = "http-helpers")] pub mod uri;