Loading crates/onion-tunnel/src/lib.rs +1 −2 Original line number Diff line number Diff line Loading @@ -71,8 +71,7 @@ impl OnionTunnel { // Handle incoming packet. Drain packets as we process them. while let Some(packet) = packets.pop_front() { if let Some(tcp_socket) = Parser::parse(packet.clone()).take() { if let Some(tcp_socket) = Parser::parse(packet.clone()).take() { let socket = TcpSocket::new(self.iface.clone(), tcp_socket); self.proxy(socket); } Loading crates/onion-tunnel/src/socket.rs +2 −8 Original line number Diff line number Diff line Loading @@ -22,15 +22,9 @@ pub struct TcpSocket { } impl TcpSocket { pub fn new( iface: IFace, s: smoltcp::socket::TcpSocket<'static>, ) -> Self { pub fn new(iface: IFace, s: smoltcp::socket::TcpSocket<'static>) -> Self { let handle = iface.lock().unwrap().add_socket(s); Self { handle, iface, } Self { handle, iface } } fn with<R>(&mut self, f: impl FnOnce(&mut smoltcp::socket::TcpSocket) -> R) -> R { Loading Loading
crates/onion-tunnel/src/lib.rs +1 −2 Original line number Diff line number Diff line Loading @@ -71,8 +71,7 @@ impl OnionTunnel { // Handle incoming packet. Drain packets as we process them. while let Some(packet) = packets.pop_front() { if let Some(tcp_socket) = Parser::parse(packet.clone()).take() { if let Some(tcp_socket) = Parser::parse(packet.clone()).take() { let socket = TcpSocket::new(self.iface.clone(), tcp_socket); self.proxy(socket); } Loading
crates/onion-tunnel/src/socket.rs +2 −8 Original line number Diff line number Diff line Loading @@ -22,15 +22,9 @@ pub struct TcpSocket { } impl TcpSocket { pub fn new( iface: IFace, s: smoltcp::socket::TcpSocket<'static>, ) -> Self { pub fn new(iface: IFace, s: smoltcp::socket::TcpSocket<'static>) -> Self { let handle = iface.lock().unwrap().add_socket(s); Self { handle, iface, } Self { handle, iface } } fn with<R>(&mut self, f: impl FnOnce(&mut smoltcp::socket::TcpSocket) -> R) -> R { Loading