Fix: urltest get fastest node ehavior (#326)

This commit is contained in:
comwrg
2019-10-12 23:29:00 +08:00
committed by Dreamacro
parent 4cd8b6f24f
commit 0cdc40beb3
5 changed files with 75 additions and 29 deletions

View File

@ -171,10 +171,7 @@ func (r *Resolver) IsFakeIP() bool {
}
func (r *Resolver) batchExchange(clients []resolver, m *D.Msg) (msg *D.Msg, err error) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
fast, ctx := picker.WithContext(ctx)
fast, ctx := picker.WithTimeout(context.Background(), time.Second)
for _, client := range clients {
r := client
fast.Go(func() (interface{}, error) {