From 5491895a602a33c458cc33e7f5699f61e5c2c822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 25 Jul 2022 16:18:22 +0800 Subject: [PATCH] Print stack if no context --- route/router.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/route/router.go b/route/router.go index e72bc218..efc75e99 100644 --- a/route/router.go +++ b/route/router.go @@ -11,6 +11,7 @@ import ( "os/user" "path/filepath" "reflect" + "runtime/debug" "strings" "time" @@ -631,6 +632,7 @@ func (r *Router) matchDNS(ctx context.Context) (context.Context, dns.Transport) metadata := adapter.ContextFrom(ctx) if metadata == nil { r.dnsLogger.WarnContext(ctx, "no context: ", reflect.TypeOf(ctx)) + debug.PrintStack() return ctx, r.defaultTransport } for i, rule := range r.dnsRules {