Browse Source

dev:udp: Add an Unlock before a continue, to fix a double lock bug

lzhfromustc 5 years ago
parent
commit
8eb945ee9b
1 changed files with 1 additions and 0 deletions
  1. 1 0
      models/proto/udp/udp.go

+ 1 - 0
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