From daf83eb6f79508876636f8800ebf4842fa24b3c9 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Fri, 21 Jan 2022 22:38:02 +0800 Subject: [PATCH] [Fixed] select group crash --- adapter/outboundgroup/selector.go | 3 +-- hub/executor/executor.go | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/adapter/outboundgroup/selector.go b/adapter/outboundgroup/selector.go index 47b8d34f..909050bf 100644 --- a/adapter/outboundgroup/selector.go +++ b/adapter/outboundgroup/selector.go @@ -100,7 +100,6 @@ func (s *Selector) selectedProxy(touch bool) C.Proxy { } func NewSelector(option *GroupCommonOption, providers []provider.ProxyProvider) *Selector { - selected := providers[0].Proxies()[0].Name() return &Selector{ Base: outbound.NewBase(outbound.BaseOption{ Name: option.Name, @@ -110,7 +109,7 @@ func NewSelector(option *GroupCommonOption, providers []provider.ProxyProvider) }), single: singledo.NewSingle(defaultGetProxiesDuration), providers: providers, - selected: selected, + selected: "COMPATIBLE", disableUDP: option.DisableUDP, filter: option.Filter, } diff --git a/hub/executor/executor.go b/hub/executor/executor.go index 6d06470f..f8e34ea8 100644 --- a/hub/executor/executor.go +++ b/hub/executor/executor.go @@ -2,7 +2,6 @@ package executor import ( "fmt" - "github.com/Dreamacro/clash/listener/tproxy" "net" "os" "runtime" @@ -10,6 +9,8 @@ import ( "strings" "sync" + "github.com/Dreamacro/clash/listener/tproxy" + "github.com/Dreamacro/clash/adapter" "github.com/Dreamacro/clash/adapter/outboundgroup" "github.com/Dreamacro/clash/component/auth" @@ -75,7 +76,6 @@ func ApplyConfig(cfg *config.Config, force bool) { updateUsers(cfg.Users) updateHosts(cfg.Hosts) - updateProfile(cfg) updateProxies(cfg.Proxies, cfg.Providers) updateRules(cfg.Rules, cfg.RuleProviders) updateIPTables(cfg.DNS, cfg.General, cfg.Tun) @@ -83,8 +83,9 @@ func ApplyConfig(cfg *config.Config, force bool) { updateGeneral(cfg.General, cfg.Tun, force) updateTun(cfg.Tun) updateExperimental(cfg) - loadProvider(cfg.RuleProviders, cfg.Providers) + updateProfile(cfg) + } func GetGeneral() *config.General {