mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-04 16:37:12 -05:00
fix race condition in dokodemo
This commit is contained in:
parent
11c7191b38
commit
265c9e4abb
@ -83,6 +83,7 @@ func (this *DokodemoDoor) Listen(port v2net.Port) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *DokodemoDoor) ListenUDP(port v2net.Port) error {
|
func (this *DokodemoDoor) ListenUDP(port v2net.Port) error {
|
||||||
|
this.udpServer = hub.NewUDPServer(this.packetDispatcher)
|
||||||
udpHub, err := hub.ListenUDP(port, this.handleUDPPackets)
|
udpHub, err := hub.ListenUDP(port, this.handleUDPPackets)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Dokodemo failed to listen on port ", port, ": ", err)
|
log.Error("Dokodemo failed to listen on port ", port, ": ", err)
|
||||||
@ -90,7 +91,6 @@ func (this *DokodemoDoor) ListenUDP(port v2net.Port) error {
|
|||||||
}
|
}
|
||||||
this.udpMutex.Lock()
|
this.udpMutex.Lock()
|
||||||
this.udpHub = udpHub
|
this.udpHub = udpHub
|
||||||
this.udpServer = hub.NewUDPServer(this.packetDispatcher)
|
|
||||||
this.udpMutex.Unlock()
|
this.udpMutex.Unlock()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user