Need to work even harder to fix the length, but this is much better
This commit is contained in:
parent
bacfa5a80c
commit
3b30c6e0b5
6
msg.go
6
msg.go
|
@ -975,10 +975,8 @@ func (dns *Msg) Pack() (msg []byte, ok bool) {
|
||||||
dh.Nscount = uint16(len(ns))
|
dh.Nscount = uint16(len(ns))
|
||||||
dh.Arcount = uint16(len(extra))
|
dh.Arcount = uint16(len(extra))
|
||||||
|
|
||||||
// Could work harder to calculate message size,
|
// TODO: still too much, but better than 64K
|
||||||
// but this is far more than we need and not
|
msg = make([]byte, dns.Len()*8)
|
||||||
// big enough to hurt the allocator.
|
|
||||||
msg = make([]byte, DefaultMsgSize) // TODO, calculate REAL size
|
|
||||||
|
|
||||||
// Pack it in: header and then the pieces.
|
// Pack it in: header and then the pieces.
|
||||||
off := 0
|
off := 0
|
||||||
|
|
Loading…
Reference in New Issue