Update miekg/dns

This commit is contained in:
Frank Denis 2021-02-24 15:38:04 +01:00
parent 34909babfb
commit 1ae2281588
39 changed files with 274 additions and 29 deletions

View file

@ -752,11 +752,10 @@ func (w *response) Write(m []byte) (int, error) {
return 0, &Error{err: "message too large"}
}
l := make([]byte, 2)
binary.BigEndian.PutUint16(l, uint16(len(m)))
n, err := (&net.Buffers{l, m}).WriteTo(w.tcp)
return int(n), err
msg := make([]byte, 2+len(m))
binary.BigEndian.PutUint16(msg, uint16(len(m)))
copy(msg[2:], m)
return w.tcp.Write(msg)
default:
panic("dns: internal error: udp and tcp both nil")
}