fix xtcp visitor panic

pull/966/head
fatedier 6 years ago
parent 698219b621
commit 1a8ac148ca

@ -13,12 +13,12 @@ import (
) )
const ( const (
ProxyStatusNew = "new" ProxyStatusNew = "new"
ProxyStatusStartErr = "start error" ProxyStatusStartErr = "start error"
ProxyStatusWaitStart = "wait start" ProxyStatusWaitStart = "wait start"
ProxyStatusRunning = "running" ProxyStatusRunning = "running"
ProxyStatusCheckFailed = "check failed" ProxyStatusCheckFailed = "check failed"
ProxyStatusClosed = "closed" ProxyStatusClosed = "closed"
) )
type ProxyManager struct { type ProxyManager struct {

@ -202,7 +202,16 @@ func (sv *XtcpVisitor) handleConn(userConn frpNet.Conn) {
raddr, err := net.ResolveUDPAddr("udp", raddr, err := net.ResolveUDPAddr("udp",
fmt.Sprintf("%s:%d", g.GlbClientCfg.ServerAddr, g.GlbClientCfg.ServerUdpPort)) fmt.Sprintf("%s:%d", g.GlbClientCfg.ServerAddr, g.GlbClientCfg.ServerUdpPort))
if err != nil {
sv.Error("resolve server UDP addr error")
return
}
visitorConn, err := net.DialUDP("udp", nil, raddr) visitorConn, err := net.DialUDP("udp", nil, raddr)
if err != nil {
sv.Warn("dial server udp addr error: %v", err)
return
}
defer visitorConn.Close() defer visitorConn.Close()
now := time.Now().Unix() now := time.Now().Unix()

Loading…
Cancel
Save