mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-04 04:17:36 +03:00
Fix outbound start sequence
This commit is contained in:
parent
4f12eba944
commit
8d5b9d240a
23 changed files with 197 additions and 105 deletions
17
box.go
17
box.go
|
@ -217,20 +217,9 @@ func (s *Box) preStart() error {
|
|||
return E.Cause(err, "pre-starting ", serviceName)
|
||||
}
|
||||
}
|
||||
for i, out := range s.outbounds {
|
||||
var tag string
|
||||
if out.Tag() == "" {
|
||||
tag = F.ToString(i)
|
||||
} else {
|
||||
tag = out.Tag()
|
||||
}
|
||||
if starter, isStarter := out.(common.Starter); isStarter {
|
||||
s.logger.Trace("initializing outbound/", out.Type(), "[", tag, "]")
|
||||
err := starter.Start()
|
||||
if err != nil {
|
||||
return E.Cause(err, "initialize outbound/", out.Type(), "[", tag, "]")
|
||||
}
|
||||
}
|
||||
err := s.startOutbounds()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return s.router.Start()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue