Skip to content

Commit

Permalink
fix(local): fixed build on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Oct 20, 2023
1 parent 99036e7 commit 6ff791f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions crates/shadowsocks-service/src/local/socks/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ impl SocksBuilder {

let mut udp_server = None;
if self.mode.enable_udp() {
#[allow(unused_mut)]
let mut builder = Socks5UdpServerBuilder::new(
self.context.clone(),
udp_bind_addr.clone(),
Expand All @@ -127,6 +128,7 @@ impl SocksBuilder {

let mut tcp_server = None;
if self.mode.enable_tcp() {
#[allow(unused_mut)]
let mut builder = SocksTcpServerBuilder::new(
self.context.clone(),
self.client_config,
Expand Down
8 changes: 4 additions & 4 deletions crates/shadowsocks-service/src/local/socks/server/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ impl SocksTcpServerBuilder {
}
};
} else {
let listener = match client_config {
let listener = match self.client_config {
ServerAddr::SocketAddr(ref saddr) => {
ShadowTcpListener::bind_with_opts(saddr, context.accept_opts()).await?
ShadowTcpListener::bind_with_opts(saddr, self.context.accept_opts()).await?
}
ServerAddr::DomainName(ref dname, port) => {
lookup_then!(context.context_ref(), dname, port, |addr| {
ShadowTcpListener::bind_with_opts(&addr, context.accept_opts()).await
lookup_then!(self.context.context_ref(), dname, port, |addr| {
ShadowTcpListener::bind_with_opts(&addr, self.context.accept_opts()).await
})?
.1
}
Expand Down

0 comments on commit 6ff791f

Please sign in to comment.