|
@@ -1819,17 +1819,6 @@ func unpackText(msg []byte, off int) (string, int, error) {
|
|
|
return string(msg[beginOff:endOff]), endOff, nil
|
|
return string(msg[beginOff:endOff]), endOff, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func skipText(msg []byte, off int) (int, error) {
|
|
|
|
|
- if off >= len(msg) {
|
|
|
|
|
- return off, errBaseLen
|
|
|
|
|
- }
|
|
|
|
|
- endOff := off + 1 + int(msg[off])
|
|
|
|
|
- if endOff > len(msg) {
|
|
|
|
|
- return off, errCalcLen
|
|
|
|
|
- }
|
|
|
|
|
- return endOff, nil
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// packBytes appends the wire format of field to msg.
|
|
// packBytes appends the wire format of field to msg.
|
|
|
func packBytes(msg []byte, field []byte) []byte {
|
|
func packBytes(msg []byte, field []byte) []byte {
|
|
|
return append(msg, field...)
|
|
return append(msg, field...)
|
|
@@ -1844,14 +1833,6 @@ func unpackBytes(msg []byte, off int, field []byte) (int, error) {
|
|
|
return newOff, nil
|
|
return newOff, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func skipBytes(msg []byte, off int, field []byte) (int, error) {
|
|
|
|
|
- newOff := off + len(field)
|
|
|
|
|
- if newOff > len(msg) {
|
|
|
|
|
- return off, errBaseLen
|
|
|
|
|
- }
|
|
|
|
|
- return newOff, nil
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const nameLen = 255
|
|
const nameLen = 255
|
|
|
|
|
|
|
|
// A Name is a non-encoded domain name. It is used instead of strings to avoid
|
|
// A Name is a non-encoded domain name. It is used instead of strings to avoid
|