Fix: udp crash in tunnel

This commit is contained in:
Dreamacro 2019-05-16 18:40:20 +08:00
parent b589754485
commit e837470a6a

View file

@ -159,10 +159,11 @@ func (t *Tunnel) handleConn(localConn C.ServerAdapter) {
if metadata.NetWork == C.UDP {
pc, addr, err := proxy.DialUDP(metadata)
defer pc.Close()
if err != nil {
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)
return