mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-09 18:43:14 +00:00
Minor fixes
This commit is contained in:
parent
8a2d3fbb28
commit
b0aaa86806
6
box.go
6
box.go
|
@ -203,7 +203,7 @@ func (s *Box) PreStart() error {
|
||||||
defer func() {
|
defer func() {
|
||||||
v := recover()
|
v := recover()
|
||||||
if v != nil {
|
if v != nil {
|
||||||
log.Error(E.Cause(err, "origin error"))
|
println(err.Error())
|
||||||
debug.PrintStack()
|
debug.PrintStack()
|
||||||
panic("panic on early close: " + fmt.Sprint(v))
|
panic("panic on early close: " + fmt.Sprint(v))
|
||||||
}
|
}
|
||||||
|
@ -222,9 +222,9 @@ func (s *Box) Start() error {
|
||||||
defer func() {
|
defer func() {
|
||||||
v := recover()
|
v := recover()
|
||||||
if v != nil {
|
if v != nil {
|
||||||
log.Error(E.Cause(err, "origin error"))
|
println(err.Error())
|
||||||
debug.PrintStack()
|
debug.PrintStack()
|
||||||
panic("panic on early close: " + fmt.Sprint(v))
|
println("panic on early start: " + fmt.Sprint(v))
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
s.Close()
|
s.Close()
|
||||||
|
|
|
@ -174,7 +174,7 @@ func (t *Tun) Start() error {
|
||||||
forwarderBindInterface = true
|
forwarderBindInterface = true
|
||||||
includeAllNetworks = t.platformInterface.IncludeAllNetworks()
|
includeAllNetworks = t.platformInterface.IncludeAllNetworks()
|
||||||
}
|
}
|
||||||
t.tunStack, err = tun.NewStack(t.stack, tun.StackOptions{
|
tunStack, err := tun.NewStack(t.stack, tun.StackOptions{
|
||||||
Context: t.ctx,
|
Context: t.ctx,
|
||||||
Tun: tunInterface,
|
Tun: tunInterface,
|
||||||
TunOptions: t.tunOptions,
|
TunOptions: t.tunOptions,
|
||||||
|
@ -190,8 +190,9 @@ func (t *Tun) Start() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
monitor.Start("initiating tun stack")
|
monitor.Start("initiating tun stack")
|
||||||
err = t.tunStack.Start()
|
err = tunStack.Start()
|
||||||
monitor.Finish()
|
monitor.Finish()
|
||||||
|
t.tunStack = tunStack
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,9 +385,9 @@ func (g *URLTestGroup) urlTest(ctx context.Context, force bool) (map[string]uint
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
b.Go(realTag, func() (any, error) {
|
b.Go(realTag, func() (any, error) {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), C.TCPTimeout)
|
testCtx, cancel := context.WithTimeout(g.ctx, C.TCPTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
t, err := urltest.URLTest(ctx, g.link, p)
|
t, err := urltest.URLTest(testCtx, g.link, p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
g.logger.Debug("outbound ", tag, " unavailable: ", err)
|
g.logger.Debug("outbound ", tag, " unavailable: ", err)
|
||||||
g.history.DeleteURLTestHistory(realTag)
|
g.history.DeleteURLTestHistory(realTag)
|
||||||
|
|
Loading…
Reference in a new issue