From 1a6a179b68f4bd40717e3e76b529ade102b86c72 Mon Sep 17 00:00:00 2001 From: fatedier Date: Tue, 5 Dec 2017 22:26:53 +0800 Subject: [PATCH] visitor: fix panic --- client/visitor.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/visitor.go b/client/visitor.go index 76f28d9..e7a22d8 100644 --- a/client/visitor.go +++ b/client/visitor.go @@ -259,7 +259,11 @@ func (sv *XtcpVisitor) handleConn(userConn frpNet.Conn) { sv.Trace("send all detect msg done") // Listen for visitorConn's address and wait for client connection. - lConn, _ := net.ListenUDP("udp", laddr) + lConn, err := net.ListenUDP("udp", laddr) + if err != nil { + sv.Error("listen on visitorConn's local adress error: %v", err) + return + } lConn.SetReadDeadline(time.Now().Add(5 * time.Second)) sidBuf := pool.GetBuf(1024) n, _, err = lConn.ReadFromUDP(sidBuf)