mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
fix bugs (#1138)
1. avoid dns query hangs the thread 2. avoid deadloop when stun query failed because of no ipv4 addr. 3. make quic input error non-fatal. 4. remove ring tunnel from connection map to avoid mem leak. 5. limit listener retry count.
This commit is contained in:
@@ -526,6 +526,19 @@ impl Instance {
|
||||
});
|
||||
}
|
||||
|
||||
async fn run_quic_dst(&mut self) -> Result<(), Error> {
|
||||
if !self.global_ctx.get_flags().enable_quic_proxy {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let quic_dst = QUICProxyDst::new(self.global_ctx.clone())?;
|
||||
quic_dst.start().await?;
|
||||
self.global_ctx
|
||||
.set_quic_proxy_port(Some(quic_dst.local_addr()?.port()));
|
||||
self.quic_proxy_dst = Some(quic_dst);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn run(&mut self) -> Result<(), Error> {
|
||||
self.listener_manager
|
||||
.lock()
|
||||
@@ -588,11 +601,12 @@ impl Instance {
|
||||
}
|
||||
|
||||
if !self.global_ctx.get_flags().disable_quic_input {
|
||||
let quic_dst = QUICProxyDst::new(self.global_ctx.clone())?;
|
||||
quic_dst.start().await?;
|
||||
self.global_ctx
|
||||
.set_quic_proxy_port(Some(quic_dst.local_addr()?.port()));
|
||||
self.quic_proxy_dst = Some(quic_dst);
|
||||
if let Err(e) = self.run_quic_dst().await {
|
||||
eprintln!(
|
||||
"quic input start failed: {:?} (some platforms may not support)",
|
||||
e
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// run after tun device created, so listener can bind to tun device, which may be required by win 10
|
||||
|
||||
Reference in New Issue
Block a user