diff options
author | 2019-03-26 14:37:30 +0000 | |
---|---|---|
committer | 2019-03-26 14:37:30 +0000 | |
commit | 53f3f0b666821588e721ceeea4766b76333b668b (patch) | |
tree | e65626cff499082a301ce1579083f021416ec90b /plugin/file/file.go | |
parent | 6492f777cdbaa75f1bdfc90c62a1b2b2e041501c (diff) | |
download | coredns-53f3f0b666821588e721ceeea4766b76333b668b.tar.gz coredns-53f3f0b666821588e721ceeea4766b76333b668b.tar.zst coredns-53f3f0b666821588e721ceeea4766b76333b668b.zip |
Remove context.Context from request.Request (#2726)
* Remove context.Context from request.Request
This removes the context from request.Request and makes all the changes
in the code to make it compile again. It's all mechanical. It did
unearth some weirdness in that the context was kept in handler structs
which may cause havoc with concurrently handling of requests.
Fixes #2721
Signed-off-by: Miek Gieben <miek@miek.nl>
* Make test compile
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/file/file.go')
-rw-r--r-- | plugin/file/file.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/file/file.go b/plugin/file/file.go index 0010f0811..40ebbedf7 100644 --- a/plugin/file/file.go +++ b/plugin/file/file.go @@ -31,7 +31,7 @@ type ( // ServeDNS implements the plugin.Handle interface. func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { - state := request.Request{W: w, Req: r, Context: ctx} + state := request.Request{W: w, Req: r} qname := state.Name() // TODO(miek): match the qname better in the map @@ -79,7 +79,7 @@ func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i return xfr.ServeDNS(ctx, w, r) } - answer, ns, extra, result := z.Lookup(state, qname) + answer, ns, extra, result := z.Lookup(ctx, state, qname) m := new(dns.Msg) m.SetReply(r) |