Revert "Share the message buffer if we have room"
This reverts commit 17ce0cd52f
.
This commit is contained in:
parent
ca87093b6d
commit
9ba617e870
10
msg.go
10
msg.go
|
@ -254,15 +254,7 @@ func packDomainName(s string, msg []byte, off int, compression map[string]int, c
|
||||||
pointer := -1
|
pointer := -1
|
||||||
// Emit sequence of counted strings, chopping at dots.
|
// Emit sequence of counted strings, chopping at dots.
|
||||||
begin := 0
|
begin := 0
|
||||||
// We can share the message buffer because we don't need to look back.
|
bs := []byte(s)
|
||||||
// Keeping close makes tests more sensitive to failure (only 1 byte of room).
|
|
||||||
var bs []byte
|
|
||||||
if len(s) < len(msg) {
|
|
||||||
bs = msg[off+1:]
|
|
||||||
copy(bs, s)
|
|
||||||
} else {
|
|
||||||
bs = []byte(s)
|
|
||||||
}
|
|
||||||
ro_bs, bs_fresh := s, true
|
ro_bs, bs_fresh := s, true
|
||||||
for i := 0; i < ls; i++ {
|
for i := 0; i < ls; i++ {
|
||||||
if bs[i] == '\\' {
|
if bs[i] == '\\' {
|
||||||
|
|
Loading…
Reference in New Issue