fix race condition in shadowsocks

pull/82/head
v2ray 2016-02-03 22:42:58 +01:00
parent 265c9e4abb
commit 2d1ded9b9e
1 changed files with 1 additions and 1 deletions

View File

@ -74,13 +74,13 @@ func (this *Shadowsocks) Listen(port v2net.Port) error {
this.tcpHub = tcpHub
if this.config.UDP {
this.udpServer = hub.NewUDPServer(this.packetDispatcher)
udpHub, err := hub.ListenUDP(port, this.handlerUDPPayload)
if err != nil {
log.Error("Shadowsocks: Failed to listen UDP on port ", port, ": ", err)
return err
}
this.udpHub = udpHub
this.udpServer = hub.NewUDPServer(this.packetDispatcher)
}
return nil