Simplify final returns from packDomainName
This commit is contained in:
parent
926752f160
commit
9358e95aef
9
msg.go
9
msg.go
|
@ -321,13 +321,14 @@ loop:
|
||||||
// We have two bytes (14 bits) to put the pointer in
|
// We have two bytes (14 bits) to put the pointer in
|
||||||
// if msg == nil, we will never do compression
|
// if msg == nil, we will never do compression
|
||||||
binary.BigEndian.PutUint16(msg[off:], uint16(pointer^0xC000))
|
binary.BigEndian.PutUint16(msg[off:], uint16(pointer^0xC000))
|
||||||
off++
|
return off + 2, labels, nil
|
||||||
} else if msg != nil && off < len(msg) {
|
}
|
||||||
|
|
||||||
|
if msg != nil && off < len(msg) {
|
||||||
msg[off] = 0
|
msg[off] = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
off++
|
return off + 1, labels, nil
|
||||||
return off, labels, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unpack a domain name.
|
// Unpack a domain name.
|
||||||
|
|
Loading…
Reference in New Issue