diff options
author | 2019-11-07 23:29:50 +0800 | |
---|---|---|
committer | 2019-11-07 15:29:50 +0000 | |
commit | 113783ed91c85eb70455b4065b74ddc470b41c55 (patch) | |
tree | 0f2ed5f155e1759369bba3d957976fd9f9367374 /plugin | |
parent | 1942746c484fc736c933678cf0e37dcb2edfe58d (diff) | |
download | coredns-113783ed91c85eb70455b4065b74ddc470b41c55.tar.gz coredns-113783ed91c85eb70455b4065b74ddc470b41c55.tar.zst coredns-113783ed91c85eb70455b4065b74ddc470b41c55.zip |
Call wg.Add in main goroutine to avoid race conditons. (#3433)
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/transfer/transfer.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/transfer/transfer.go b/plugin/transfer/transfer.go index 9f8691548..0bf92ac47 100644 --- a/plugin/transfer/transfer.go +++ b/plugin/transfer/transfer.go @@ -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() }() |