From 27f35076d15fe1c2dbf3870cc3a973e50c53e7dc Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Wed, 12 Jun 2024 02:14:40 +0800 Subject: [PATCH] fix(local-online-build): fixed build with default features --- crates/shadowsocks-service/src/config.rs | 2 ++ crates/shadowsocks-service/src/local/http/http_client.rs | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/shadowsocks-service/src/config.rs b/crates/shadowsocks-service/src/config.rs index 3fe93c43d3fb..a35e19f5bea0 100644 --- a/crates/shadowsocks-service/src/config.rs +++ b/crates/shadowsocks-service/src/config.rs @@ -2380,6 +2380,7 @@ impl Config { nconfig.acl = Some(acl); } + #[cfg(feature = "local-online-config")] if let Some(online_config) = config.online_config { nconfig.online_config = Some(OnlineConfig { config_url: online_config.config_url, @@ -3126,6 +3127,7 @@ impl fmt::Display for Config { } // OnlineConfig + #[cfg(feature = "local-online-config")] if let Some(ref online_config) = self.online_config { jconf.online_config = Some(SSOnlineConfig { config_url: online_config.config_url.clone(), diff --git a/crates/shadowsocks-service/src/local/http/http_client.rs b/crates/shadowsocks-service/src/local/http/http_client.rs index 27306158b5f4..2db5426a1585 100644 --- a/crates/shadowsocks-service/src/local/http/http_client.rs +++ b/crates/shadowsocks-service/src/local/http/http_client.rs @@ -11,12 +11,13 @@ use std::{ time::{Duration, Instant}, }; -use hyper::rt::{Sleep, Timer}; use hyper::{ body::{self, Body}, client::conn::{http1, http2}, http::uri::Scheme, - Request, Response, + rt::{Sleep, Timer}, + Request, + Response, }; use log::{error, trace}; use lru_time_cache::LruCache;