From d06aa29bc8d45f35aa067e03432f03d889e49ed3 Mon Sep 17 00:00:00 2001 From: Yuzuki616 Date: Wed, 9 Aug 2023 19:19:36 +0800 Subject: [PATCH] fix panic for sing --- core/sing/sing.go | 2 ++ go.mod | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/sing/sing.go b/core/sing/sing.go index 1f5a814..9c6e6ff 100644 --- a/core/sing/sing.go +++ b/core/sing/sing.go @@ -20,6 +20,7 @@ import ( "github.com/sagernet/sing/common" E "github.com/sagernet/sing/common/exceptions" F "github.com/sagernet/sing/common/format" + "github.com/sagernet/sing/service/pause" ) var _ adapter.Service = (*Box)(nil) @@ -48,6 +49,7 @@ func New(c *conf.CoreConfig) (vCore.Core, error) { Output: c.SingConfig.LogConfig.Output, } ctx := context.Background() + ctx = pause.ContextWithDefaultManager(ctx) createdAt := time.Now() experimentalOptions := common.PtrValueOrDefault(options.Experimental) applyDebugOptions(common.PtrValueOrDefault(experimentalOptions.Debug)) diff --git a/go.mod b/go.mod index b03f89c..40073d0 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/inazumav/sing-box v0.0.0-20230730105931-e8479113c010 github.com/juju/ratelimit v1.0.2 github.com/oschwald/geoip2-golang v1.9.0 - github.com/sagernet/sing v0.2.9 + github.com/sagernet/sing v0.2.10-0.20230807080248-4db0062caa0a github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 github.com/xtls/xray-core v1.8.3