mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-19 13:29:09 +00:00
minor change
This commit is contained in:
parent
da5f7277aa
commit
f049e4a998
3 changed files with 3 additions and 3 deletions
|
@ -259,7 +259,7 @@ async fn process_client_udp_req(args: &UdpGwArgs, tx: Sender<Vec<u8>>, client: C
|
|||
log::error!("client {} received packet too long", client.addr);
|
||||
break;
|
||||
}
|
||||
log::debug!("client {} recvied packet len {}", client.addr, packet_len);
|
||||
log::trace!("client {} recvied packet len {}", client.addr, packet_len);
|
||||
client.buf.clear();
|
||||
let mut left_len: usize = packet_len as usize;
|
||||
while left_len > 0 {
|
||||
|
|
|
@ -497,7 +497,7 @@ async fn handle_udp_gateway_session(
|
|||
let mut server_stream = match udpgw_client.get_server_connection().await {
|
||||
Some(server) => server,
|
||||
None => {
|
||||
if udpgw_client.is_full().await {
|
||||
if udpgw_client.is_full() {
|
||||
return Err("max udpgw connection limit reached".into());
|
||||
}
|
||||
let mut tcp_server_stream = create_tcp_stream(&socket_queue, server_addr).await?;
|
||||
|
|
|
@ -278,7 +278,7 @@ impl UdpGwClient {
|
|||
self.udp_timeout
|
||||
}
|
||||
|
||||
pub(crate) async fn is_full(&self) -> bool {
|
||||
pub(crate) fn is_full(&self) -> bool {
|
||||
TCP_COUNTER.load(Relaxed) >= self.max_connections as u32
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue