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 {:?}", | ||||
|                 proxy.default_action, proxy.name | ||||
|             ); | ||||
|             return process( | ||||
|                 inbound, | ||||
|                 proxy.upstream.get(&proxy.default_action).unwrap().clone(), | ||||
|             ) | ||||
|             .await; | ||||
|             return process(inbound, proxy.upstream.get(&proxy.default_action).unwrap()).await; | ||||
|             // ToDo: Remove unwrap and check default option | ||||
|         } | ||||
|     }; | ||||
|  | ||||
|     return process(inbound, upstream.clone()).await; | ||||
|     return process(inbound, &upstream).await; | ||||
| } | ||||
|  | ||||
| async fn process( | ||||
|     mut inbound: TcpStream, | ||||
|     upstream: Upstream, | ||||
|     upstream: &Upstream, | ||||
| ) -> Result<(), Box<dyn std::error::Error>> { | ||||
|     match upstream { | ||||
|         Upstream::Ban => { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user