add fallback for RP mbox, add a few more tests

This commit is contained in:
silverwind 2019-01-22 22:48:57 +01:00
parent 0d8791efad
commit 2764de3e02
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443
2 changed files with 6 additions and 3 deletions

View File

@ -913,7 +913,7 @@ rrp.decode = function (buf, offset) {
rrp.decode.bytes = 0
rrp.encodingLength = function (data) {
return 2 + name.encodingLength(data.mbox) + name.encodingLength(data.txt || '.')
return 2 + name.encodingLength(data.mbox || '.') + name.encodingLength(data.txt || '.')
}
const typebitmap = {}

View File

@ -405,9 +405,12 @@ tape('rrp', function (t) {
txt: 'baz.bar.com'
})
testEncoder(t, packet.rp, {
mbox: 'rp.world.com',
txt: '.'
mbox: 'foo.bar.com'
})
testEncoder(t, packet.rp, {
txt: 'baz.bar.com'
})
testEncoder(t, packet.rp, {})
t.end()
})