From 53f3f0b666821588e721ceeea4766b76333b668b Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Tue, 26 Mar 2019 14:37:30 +0000 Subject: 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 * Make test compile Signed-off-by: Miek Gieben --- plugin/file/reload_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugin/file/reload_test.go') diff --git a/plugin/file/reload_test.go b/plugin/file/reload_test.go index 2f7b6cf0f..1139b8a44 100644 --- a/plugin/file/reload_test.go +++ b/plugin/file/reload_test.go @@ -1,6 +1,7 @@ package file import ( + "context" "io/ioutil" "os" "strings" @@ -33,17 +34,18 @@ func TestZoneReload(t *testing.T) { z.Reload() time.Sleep(time.Second) + ctx := context.TODO() r := new(dns.Msg) r.SetQuestion("miek.nl", dns.TypeSOA) state := request.Request{W: &test.ResponseWriter{}, Req: r} - if _, _, _, res := z.Lookup(state, "miek.nl."); res != Success { + if _, _, _, res := z.Lookup(ctx, state, "miek.nl."); res != Success { t.Fatalf("Failed to lookup, got %d", res) } r = new(dns.Msg) r.SetQuestion("miek.nl", dns.TypeNS) state = request.Request{W: &test.ResponseWriter{}, Req: r} - if _, _, _, res := z.Lookup(state, "miek.nl."); res != Success { + if _, _, _, res := z.Lookup(ctx, state, "miek.nl."); res != Success { t.Fatalf("Failed to lookup, got %d", res) } -- cgit v1.2.3