remove dnstest changes

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2021-10-11 12:42:28 +02:00
parent f7a53029c9
commit 7a592ae60f

View File

@@ -2,7 +2,6 @@
package dnstest package dnstest
import ( import (
"runtime"
"time" "time"
"github.com/miekg/dns" "github.com/miekg/dns"
@@ -20,10 +19,6 @@ type Recorder struct {
Len int Len int
Msg *dns.Msg Msg *dns.Msg
Start time.Time Start time.Time
// CallerN holds string return value of the call to runtime.Caller(N)
Caller1 string
Caller2 string
Caller3 string
} }
// NewRecorder makes and returns a new Recorder, // NewRecorder makes and returns a new Recorder,
@@ -41,9 +36,6 @@ func NewRecorder(w dns.ResponseWriter) *Recorder {
// WriteMsg records the status code and calls the // WriteMsg records the status code and calls the
// underlying ResponseWriter's WriteMsg method. // underlying ResponseWriter's WriteMsg method.
func (r *Recorder) WriteMsg(res *dns.Msg) error { func (r *Recorder) WriteMsg(res *dns.Msg) error {
_, r.Caller1, _, _ = runtime.Caller(1)
_, r.Caller2, _, _ = runtime.Caller(2)
_, r.Caller3, _, _ = runtime.Caller(3)
// We may get called multiple times (axfr for instance). // We may get called multiple times (axfr for instance).
// Save the last message, but add the sizes. // Save the last message, but add the sizes.
r.Len += res.Len() r.Len += res.Len()