From 99e68846d7377e5af4d14e47f95da9043124c069 Mon Sep 17 00:00:00 2001 From: Yuzuki616 Date: Tue, 17 Oct 2023 19:15:13 +0800 Subject: [PATCH] fix panic --- core/sing/hook.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/sing/hook.go b/core/sing/hook.go index 699a08e..f58f749 100644 --- a/core/sing/hook.go +++ b/core/sing/hook.go @@ -81,7 +81,8 @@ func (h *HookServer) RoutedConnection(_ context.Context, conn net.Conn, m adapte t := &Tracker{} l, err := limiter.GetLimiter(m.Inbound) if err != nil { - log.Error("get limiter for ", m.Inbound, " error: ", err) + h.logger.Warn("get limiter for ", m.Inbound, " error: ", err) + return conn, t } if l.CheckDomainRule(m.Domain) { conn.Close() @@ -134,7 +135,8 @@ func (h *HookServer) RoutedPacketConnection(_ context.Context, conn N.PacketConn t := &Tracker{} l, err := limiter.GetLimiter(m.Inbound) if err != nil { - log.Error("get limiter for ", m.Inbound, " error: ", err) + h.logger.Warn("get limiter for ", m.Inbound, " error: ", err) + return conn, t } if l.CheckDomainRule(m.Domain) { conn.Close()