releasing lock before await-point
This commit is contained in:
parent
882fbcf669
commit
191dffd03e
@ -508,13 +508,14 @@ impl Connection {
|
|||||||
Address::SocketAddress(addr) => Socks5Address::SocketAddress(addr),
|
Address::SocketAddress(addr) => Socks5Address::SocketAddress(addr),
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(session) = SOCKS5_UDP_SESSIONS
|
let session = SOCKS5_UDP_SESSIONS
|
||||||
.get()
|
.get()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.lock()
|
.lock()
|
||||||
.get(&assoc_id)
|
.get(&assoc_id)
|
||||||
.cloned()
|
.cloned();
|
||||||
{
|
|
||||||
|
if let Some(session) = session {
|
||||||
if let Err(err) = session.send(pkt, addr).await {
|
if let Err(err) = session.send(pkt, addr).await {
|
||||||
log::warn!(
|
log::warn!(
|
||||||
"[relay] [packet] [{assoc_id:#06x}] [from-native] [{pkt_id:#06x}] failed sending packet to socks5 client: {err}",
|
"[relay] [packet] [{assoc_id:#06x}] [from-native] [{pkt_id:#06x}] failed sending packet to socks5 client: {err}",
|
||||||
|
@ -147,7 +147,7 @@ impl Server {
|
|||||||
Self::handle_bind(bind).await;
|
Self::handle_bind(bind).await;
|
||||||
}
|
}
|
||||||
Ok(Connection::Connect(connect, target_addr)) => {
|
Ok(Connection::Connect(connect, target_addr)) => {
|
||||||
log::info!("[socks5] [{addr}] [connect] [{target_addr}]");
|
log::info!("[socks5] [{addr}] [connect] {target_addr}");
|
||||||
Self::handle_connect(connect, target_addr).await;
|
Self::handle_connect(connect, target_addr).await;
|
||||||
}
|
}
|
||||||
Err(err) => log::warn!("[socks5] [{addr}] handshake error: {err}"),
|
Err(err) => log::warn!("[socks5] [{addr}] handshake error: {err}"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user