格式化代码
This commit is contained in:
@@ -249,7 +249,7 @@ async fn res_symmetric_handle_loop(
|
||||
}
|
||||
match tokio::time::timeout(Duration::from_secs(30), receiver.recv()).await {
|
||||
Ok(_) => {}
|
||||
Err(e) => {}
|
||||
Err(_e) => {}
|
||||
}
|
||||
loop {
|
||||
tokio::select! {
|
||||
|
||||
@@ -32,7 +32,7 @@ pub async fn udp_recv_start<F>(
|
||||
udp: UdpSocket,
|
||||
server_addr: SocketAddr,
|
||||
other_sender: Sender<(SocketAddr, Vec<u8>)>,
|
||||
mut tun_writer: TunWriter,
|
||||
tun_writer: TunWriter,
|
||||
current_device: CurrentDeviceInfo,
|
||||
stop_fn: F,
|
||||
) where
|
||||
@@ -275,7 +275,7 @@ fn other_handle(
|
||||
}
|
||||
Protocol::Control => {
|
||||
match ControlPacket::new(net_packet.transport_protocol(), net_packet.payload())? {
|
||||
ControlPacket::PingPacket(ping) => {
|
||||
ControlPacket::PingPacket(_ping) => {
|
||||
net_packet.set_transport_protocol(control_packet::Protocol::Pong.into());
|
||||
udp.send_to(&net_packet.buffer()[..12], peer_addr)?;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::io;
|
||||
use std::io::{Error, Read, Write};
|
||||
|
||||
|
||||
use std::net::Ipv4Addr;
|
||||
use std::os::unix::process::CommandExt;
|
||||
|
||||
use std::process::Command;
|
||||
|
||||
use bytes::BufMut;
|
||||
use tun::platform::posix::{Reader, Writer};
|
||||
|
||||
|
||||
use tun::Device;
|
||||
|
||||
use crate::tun_device::{TunReader, TunWriter};
|
||||
|
||||
Reference in New Issue
Block a user