From 8eb945ee9b14c1e4b513d401ddf21a8ce922651e Mon Sep 17 00:00:00 2001 From: lzhfromustc Date: Mon, 14 Oct 2019 23:35:08 -0400 Subject: [PATCH] dev:udp: Add an Unlock before a continue, to fix a double lock bug --- models/proto/udp/udp.go | 1 + 1 file changed, 1 insertion(+) diff --git a/models/proto/udp/udp.go b/models/proto/udp/udp.go index 26776341..ed7f95a9 100644 --- a/models/proto/udp/udp.go +++ b/models/proto/udp/udp.go @@ -117,6 +117,7 @@ func Forwarder(dstAddr *net.UDPAddr, readCh <-chan *msg.UdpPacket, sendCh chan<- if !ok { udpConn, err = net.DialUDP("udp", nil, dstAddr) if err != nil { + mu.Unlock() continue } udpConnMap[udpMsg.RemoteAddr.String()] = udpConn