mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 19:56:51 +08:00
Fix(url-test): incorrect result
This commit is contained in:
parent
9e77c650d9
commit
0670275533
|
@ -106,12 +106,13 @@ func (u *URLTest) speedTest() {
|
|||
defer cancel()
|
||||
picker, ctx := picker.WithContext(ctx)
|
||||
for _, p := range u.proxies {
|
||||
proxy := p
|
||||
picker.Go(func() (interface{}, error) {
|
||||
_, err := p.URLTest(ctx, u.rawURL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
t, err := proxy.URLTest(ctx, u.rawURL)
|
||||
if err != nil || t == 0 {
|
||||
return nil, errors.New("speed test error")
|
||||
}
|
||||
return p, nil
|
||||
return proxy, nil
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user