Updates and bug fixes #2
@ -72,21 +72,17 @@ async fn accept(inbound: TcpStream, proxy: Arc<Proxy>) -> Result<(), Box<dyn std
|
|||||||
"No upstream named {:?} on server {:?}",
|
"No upstream named {:?} on server {:?}",
|
||||||
proxy.default_action, proxy.name
|
proxy.default_action, proxy.name
|
||||||
);
|
);
|
||||||
return process(
|
return process(inbound, proxy.upstream.get(&proxy.default_action).unwrap()).await;
|
||||||
inbound,
|
|
||||||
proxy.upstream.get(&proxy.default_action).unwrap().clone(),
|
|
||||||
)
|
|
||||||
.await;
|
|
||||||
// ToDo: Remove unwrap and check default option
|
// ToDo: Remove unwrap and check default option
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return process(inbound, upstream.clone()).await;
|
return process(inbound, &upstream).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn process(
|
async fn process(
|
||||||
mut inbound: TcpStream,
|
mut inbound: TcpStream,
|
||||||
upstream: Upstream,
|
upstream: &Upstream,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
match upstream {
|
match upstream {
|
||||||
Upstream::Ban => {
|
Upstream::Ban => {
|
||||||
|
Loading…
Reference in New Issue
Block a user