mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
visitor: fix panic
This commit is contained in:
parent
ae9a4623d9
commit
1a6a179b68
@ -259,7 +259,11 @@ func (sv *XtcpVisitor) handleConn(userConn frpNet.Conn) {
|
|||||||
sv.Trace("send all detect msg done")
|
sv.Trace("send all detect msg done")
|
||||||
|
|
||||||
// Listen for visitorConn's address and wait for client connection.
|
// 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))
|
lConn.SetReadDeadline(time.Now().Add(5 * time.Second))
|
||||||
sidBuf := pool.GetBuf(1024)
|
sidBuf := pool.GetBuf(1024)
|
||||||
n, _, err = lConn.ReadFromUDP(sidBuf)
|
n, _, err = lConn.ReadFromUDP(sidBuf)
|
||||||
|
Loading…
Reference in New Issue
Block a user