diff --git a/src/config.rs b/src/config.rs index d6d9538..cd6a69f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -150,17 +150,14 @@ fn load_config(path: &str) -> Result { } } + let addr = UpstreamAddress::new(format!("{}:{}", upstream_host, upstream_port)); parsed_upstream.insert( name.to_string(), Upstream::Proxy(ProxyToUpstream { name: name.to_string(), addr: format!("{}:{}", upstream_host, upstream_port), protocol: upstream_url.scheme().to_string(), - addresses: Addr(Mutex::new(UpstreamAddress::new(format!( - "{}:{}", - upstream_host, upstream_port - )))), - ..Default::default() + addresses: Addr(Mutex::new(addr)), }), ); } diff --git a/src/servers/protocol/tcp.rs b/src/servers/protocol/tcp.rs index f20929a..43e2987 100644 --- a/src/servers/protocol/tcp.rs +++ b/src/servers/protocol/tcp.rs @@ -77,7 +77,7 @@ async fn accept(inbound: TcpStream, proxy: Arc) -> Result<(), Box Result<(), Box> { match upstream { Upstream::Ban => { - let _ = inbound.shutdown(); + inbound.shutdown().await?; } Upstream::Echo => { let (mut ri, mut wi) = io::split(inbound);