chore: always pass context when resolve dns

This commit is contained in:
wwqgtxx
2022-11-12 13:18:36 +08:00
parent dbadf37823
commit 901a47318d
20 changed files with 156 additions and 135 deletions

View File

@@ -1,14 +1,18 @@
package dns
import D "github.com/miekg/dns"
import (
"context"
D "github.com/miekg/dns"
)
type LocalServer struct {
handler handler
}
// ServeMsg implement resolver.LocalServer ResolveMsg
func (s *LocalServer) ServeMsg(msg *D.Msg) (*D.Msg, error) {
return handlerWithContext(s.handler, msg)
func (s *LocalServer) ServeMsg(ctx context.Context, msg *D.Msg) (*D.Msg, error) {
return handlerWithContext(ctx, s.handler, msg)
}
func NewLocalServer(resolver *Resolver, mapper *ResolverEnhancer) *LocalServer {