From 265c9e4abb35712324d48f3c229217813fd2fa41 Mon Sep 17 00:00:00 2001 From: v2ray Date: Wed, 3 Feb 2016 22:42:44 +0100 Subject: [PATCH] fix race condition in dokodemo --- proxy/dokodemo/dokodemo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/dokodemo/dokodemo.go b/proxy/dokodemo/dokodemo.go index 6ba7ca73..83e4a342 100644 --- a/proxy/dokodemo/dokodemo.go +++ b/proxy/dokodemo/dokodemo.go @@ -83,6 +83,7 @@ func (this *DokodemoDoor) Listen(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) if err != nil { 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.udpHub = udpHub - this.udpServer = hub.NewUDPServer(this.packetDispatcher) this.udpMutex.Unlock() return nil }