Print stack if no context

This commit is contained in:
世界 2022-07-25 16:18:22 +08:00
parent 9394674b63
commit 5491895a60
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -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 {