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

View File

@@ -36,6 +36,7 @@ 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.Rcode = res.Rcode
// 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()