mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-14 05:37:23 +08:00
fix wg client hang after some time (#297)
wg portal doesn't know client disconnect causing msg overstocked in queue, make entire peer packet process pipeline hang.
This commit is contained in:
@@ -19,6 +19,13 @@ impl MpscTunnelSender {
|
||||
self.0.send(item).await.with_context(|| "send error")?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn try_send(&self, item: ZCPacket) -> Result<(), TunnelError> {
|
||||
self.0.try_send(item).map_err(|e| match e {
|
||||
tachyonix::TrySendError::Full(_) => TunnelError::BufferFull,
|
||||
tachyonix::TrySendError::Closed(_) => TunnelError::Shutdown,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MpscTunnel<T> {
|
||||
|
||||
Reference in New Issue
Block a user