mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 19:56:51 +08:00
Fix: udp crash in tunnel
This commit is contained in:
parent
e7f4103c85
commit
7528b012c4
|
@ -159,10 +159,11 @@ func (t *Tunnel) handleConn(localConn C.ServerAdapter) {
|
||||||
|
|
||||||
if metadata.NetWork == C.UDP {
|
if metadata.NetWork == C.UDP {
|
||||||
pc, addr, err := proxy.DialUDP(metadata)
|
pc, addr, err := proxy.DialUDP(metadata)
|
||||||
defer pc.Close()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnln("Proxy[%s] connect [%s --> %s] error: %s", proxy.Name(), metadata.SrcIP.String(), metadata.String(), err.Error())
|
log.Warnln("Proxy[%s] connect [%s --> %s] error: %s", proxy.Name(), metadata.SrcIP.String(), metadata.String(), err.Error())
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
defer pc.Close()
|
||||||
|
|
||||||
t.handleUDPOverTCP(localConn, pc, addr)
|
t.handleUDPOverTCP(localConn, pc, addr)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user