mirror of
https://github.com/coredns/coredns.git
synced 2025-11-10 14:02:16 -05:00
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user