Commit d42d232a authored by chenzhengzhang's avatar chenzhengzhang
Browse files

[trac1128] update comments and minor fix

parent 34634d2b
......@@ -126,6 +126,8 @@ SRV::toWire(AbstractMessageRenderer& renderer) const {
renderer.writeUint16(impl_->priority_);
renderer.writeUint16(impl_->weight_);
renderer.writeUint16(impl_->port_);
// According to RFC 2782, name compression is not
// to be used for this field.
renderer.writeName(impl_->target_, false);
}
......
......@@ -111,6 +111,10 @@ TEST_F(Rdata_SRV_Test, createFromWire) {
EXPECT_THROW(rdataFactoryFromFile(RRType("SRV"), RRClass("IN"),
"rdata_cname_fromWire", 69),
DNSMessageFORMERR);
// parse compressed target name
EXPECT_EQ(0, rdata_srv.compare(
*rdataFactoryFromFile(RRType("SRV"), RRClass("IN"),
"rdata_srv_fromWire", 89)));
}
TEST_F(Rdata_SRV_Test, toWireBuffer) {
......
......@@ -20,8 +20,17 @@
# 8 9 50 1 2 3 4 5 6 7 8 9 60 1 2 3 4 5 6 7 8
00 01 00 05 05 dc 01 61 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00
#
#
# incomplete target name
# 9 70
00 06
# 1 2 3 4 5 6 7 8 9 70 1 2 3 4 5 6 7 8
00 12
# 1 2 3 4 5 6 7 8 9 80 1 2 3 4 5 6 7 8
00 01 00 05 05 dc 01 61 07 65 78 61 6d 70 6c 65 03 63
#
#
# Valid compressed target name: 'a' + pointer
# 9 90
00 0a
#
# 1 2 3 4 5 6 7 8 9 100
00 01 00 05 05 dc 01 61 c0 0a
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment