Improve: Dial would reset proxy alive status

This commit is contained in:
Dreamacro
2019-03-16 00:43:16 +08:00
parent 8c608f5d7a
commit acf55a7f64
9 changed files with 103 additions and 122 deletions

View File

@ -1,7 +1,6 @@
package executor
import (
adapters "github.com/Dreamacro/clash/adapters/outbound"
"github.com/Dreamacro/clash/config"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/dns"
@ -66,14 +65,9 @@ func updateProxies(proxies map[string]C.Proxy) {
tunnel := T.Instance()
oldProxies := tunnel.Proxies()
// close old goroutine
// close proxy group goroutine
for _, proxy := range oldProxies {
switch raw := proxy.(type) {
case *adapters.URLTest:
raw.Close()
case *adapters.Fallback:
raw.Close()
}
proxy.Destroy()
}
tunnel.UpdateProxies(proxies)