mirror of
https://github.com/SagerNet/sing-shadowsocks.git
synced 2025-04-03 20:07:40 +03:00
Refactor error handler
This commit is contained in:
parent
14c8cee479
commit
574f87527b
7 changed files with 13 additions and 13 deletions
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module github.com/sagernet/sing-shadowsocks
|
|||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/sagernet/sing v0.0.0-20220630111757-30b5895320a5
|
||||
github.com/sagernet/sing v0.0.0-20220630130201-63a57e6e1286
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
|
||||
lukechampine.com/blake3 v1.1.7
|
||||
)
|
||||
|
|
4
go.sum
4
go.sum
|
@ -1,8 +1,8 @@
|
|||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.0.12 h1:p9dKCg8i4gmOxtv35DvrYoWqYzQrvEVdjQ762Y0OqZE=
|
||||
github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
|
||||
github.com/sagernet/sing v0.0.0-20220630111757-30b5895320a5 h1:/JHYZ6IY4Q0hkxN2NXaFj8lTJloikj8dekOTsGudrFo=
|
||||
github.com/sagernet/sing v0.0.0-20220630111757-30b5895320a5/go.mod h1:3ZmoGNg/nNJTyHAZFNRSPaXpNIwpDvyIiAUd0KIWV5c=
|
||||
github.com/sagernet/sing v0.0.0-20220630130201-63a57e6e1286 h1:KQQvqXMEs5V1mUNeH+PrNWpXxJaaWCo+njCaeEgLUR0=
|
||||
github.com/sagernet/sing v0.0.0-20220630130201-63a57e6e1286/go.mod h1:3ZmoGNg/nNJTyHAZFNRSPaXpNIwpDvyIiAUd0KIWV5c=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b h1:2n253B2r0pYSmEV+UNCQoPfU/FiaizQEK5Gu4Bq4JE8=
|
||||
|
|
4
none.go
4
none.go
|
@ -228,6 +228,6 @@ func (w *nonePacketWriter) Upstream() any {
|
|||
return w.source
|
||||
}
|
||||
|
||||
func (s *NoneService) HandleError(err error) {
|
||||
s.handler.HandleError(err)
|
||||
func (s *NoneService) NewError(ctx context.Context, err error) {
|
||||
s.handler.NewError(ctx, err)
|
||||
}
|
||||
|
|
|
@ -122,8 +122,8 @@ func (s *Service) newConnection(ctx context.Context, conn net.Conn, metadata M.M
|
|||
}, metadata)
|
||||
}
|
||||
|
||||
func (s *Service) HandleError(err error) {
|
||||
s.handler.HandleError(err)
|
||||
func (s *Service) NewError(ctx context.Context, err error) {
|
||||
s.handler.NewError(ctx, err)
|
||||
}
|
||||
|
||||
type serverConn struct {
|
||||
|
|
|
@ -233,6 +233,6 @@ func (s *RelayService[U]) newPacket(ctx context.Context, conn N.PacketConn, buff
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *RelayService[U]) HandleError(err error) {
|
||||
s.handler.HandleError(err)
|
||||
func (s *RelayService[U]) NewError(ctx context.Context, err error) {
|
||||
s.handler.NewError(ctx, err)
|
||||
}
|
||||
|
|
|
@ -474,8 +474,8 @@ process:
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *Service) HandleError(err error) {
|
||||
s.handler.HandleError(err)
|
||||
func (s *Service) NewError(ctx context.Context, err error) {
|
||||
s.handler.NewError(ctx, err)
|
||||
}
|
||||
|
||||
type serverPacketWriter struct {
|
||||
|
|
|
@ -71,6 +71,6 @@ func (h *multiHandler) NewPacketConnection(ctx context.Context, conn N.PacketCon
|
|||
return nil
|
||||
}
|
||||
|
||||
func (h *multiHandler) HandleError(err error) {
|
||||
h.t.Error(err)
|
||||
func (h *multiHandler) NewError(ctx context.Context, err error) {
|
||||
h.t.Error(ctx, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue