mirror of
https://github.com/soypat/lneto.git
synced 2026-09-08 15:59:10 +00:00
DNS resolution working butter smooth
This commit is contained in:
@@ -221,3 +221,18 @@ func (m *Message) String() string {
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func TestDecodeMessage(t *testing.T) {
|
||||
var data = []byte{
|
||||
0x84, 0x05, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x77, 0x68, 0x69,
|
||||
0x74, 0x74, 0x69, 0x6c, 0x65, 0x61, 0x6b, 0x73, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00,
|
||||
0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x1e, 0xaf, 0x00, 0x04, 0xc6, 0x31, 0x17,
|
||||
0x91, 0x00, 0x00, 0x29, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
}
|
||||
var msg Message
|
||||
msg.LimitResourceDecoding(5, 5, 5, 5)
|
||||
off, incomplete, err := msg.Decode(data)
|
||||
if incomplete || err != nil {
|
||||
t.Fatal(incomplete, err, off)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user