Commit 113783ed authored by Guangming Wang's avatar Guangming Wang Committed by Miek Gieben

Call wg.Add in main goroutine to avoid race conditons. (#3433)

Signed-off-by: default avatarGuangming Wang <guangming.wang@daocloud.io>
parent 1942746c
......@@ -109,8 +109,8 @@ func (t Transfer) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
ch := make(chan *dns.Envelope)
tr := new(dns.Transfer)
wg := new(sync.WaitGroup)
wg.Add(1)
go func() {
wg.Add(1)
tr.Out(w, r, ch)
wg.Done()
}()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment