mirror of
https://github.com/arampoire/onetun.git
synced 2026-01-16 11:40:23 -05:00
Cleanup usage of anyhow with_context
This commit is contained in:
parent
3ccd000ea8
commit
ce40f85efa
9 changed files with 55 additions and 69 deletions
|
|
@ -56,7 +56,7 @@ impl TcpVirtualInterface {
|
|||
IpAddress::from(port_forward.destination.ip()),
|
||||
port_forward.destination.port(),
|
||||
))
|
||||
.with_context(|| "Virtual server socket failed to listen")?;
|
||||
.context("Virtual server socket failed to listen")?;
|
||||
|
||||
Ok(socket)
|
||||
}
|
||||
|
|
@ -218,7 +218,7 @@ impl VirtualInterfacePoll for TcpVirtualInterface {
|
|||
),
|
||||
(IpAddress::from(self.source_peer_ip), virtual_port.num()),
|
||||
)
|
||||
.with_context(|| "Virtual server socket failed to listen")?;
|
||||
.context("Virtual server socket failed to listen")?;
|
||||
|
||||
next_poll = None;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ impl UdpVirtualInterface {
|
|||
IpAddress::from(port_forward.destination.ip()),
|
||||
port_forward.destination.port(),
|
||||
))
|
||||
.with_context(|| "UDP virtual server socket failed to bind")?;
|
||||
.context("UDP virtual server socket failed to bind")?;
|
||||
Ok(socket)
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ impl UdpVirtualInterface {
|
|||
let mut socket = udp::Socket::new(udp_rx_buffer, udp_tx_buffer);
|
||||
socket
|
||||
.bind((IpAddress::from(source_peer_ip), client_port.num()))
|
||||
.with_context(|| "UDP virtual client failed to bind")?;
|
||||
.context("UDP virtual client failed to bind")?;
|
||||
Ok(socket)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue