mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
plugin/dnstap: some cleanup (#1172)
Some cleanup in proxy and dnstap: * just use time pkg directly and side step the indirection for Epoch * Use Set in SetQueryEpoch to be more Go like. (Looked like a reader) * Don't maintain two sets of time, we already track start, so use that. * Use time.Time and convert when needed * dedent the toDnstap function and put in a separate file
This commit is contained in:
@@ -79,7 +79,7 @@ func (h Dnstap) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
||||
newCtx := context.WithValue(ctx, DnstapSendOption, &sendOption)
|
||||
|
||||
rw := &taprw.ResponseWriter{ResponseWriter: w, Tapper: &h, Query: r, Send: &sendOption}
|
||||
rw.QueryEpoch()
|
||||
rw.SetQueryEpoch()
|
||||
|
||||
code, err := plugin.NextOrFailure(h.Name(), h.Next, tapContext{newCtx, h}, rw, r)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user