Fix(dns): use closure client (#251)

This commit is contained in:
gVisor bot 2019-08-02 09:22:09 +08:00
parent 8ded4918b2
commit 72beaf1327

View file

@ -182,7 +182,8 @@ func (r *Resolver) batchExchange(clients []resolver, m *D.Msg) (msg *D.Msg, err
defer cancel() defer cancel()
fast, ctx := picker.WithContext(ctx) fast, ctx := picker.WithContext(ctx)
for _, r := range clients { for _, client := range clients {
r := client
fast.Go(func() (interface{}, error) { fast.Go(func() (interface{}, error) {
msg, err := r.ExchangeContext(ctx, m) msg, err := r.ExchangeContext(ctx, m)
if err != nil || msg.Rcode != D.RcodeSuccess { if err != nil || msg.Rcode != D.RcodeSuccess {