Commit 1faaf0fb authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

avoid byte-by-byte copy


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1095 e5f2f494-b856-4b98-b285-d166d9295462
parent 877de8a0
......@@ -90,12 +90,10 @@ DNSKEY::DNSKEY(InputBuffer& buffer, size_t rdata_len)
uint16_t flags = buffer.readUint16();
uint16_t protocol = buffer.readUint8();
uint16_t algorithm = buffer.readUint8();
vector<uint8_t> keydata;
rdata_len -= 4;
for (int i = 0; i < rdata_len; i++) {
keydata.push_back(buffer.readUint8());
}
vector<uint8_t> keydata(rdata_len);
buffer.readData(&keydata[0], rdata_len);
impl_ = new DNSKEYImpl(flags, protocol, algorithm, keydata);
}
......
......@@ -85,12 +85,10 @@ DS::DS(InputBuffer& buffer, size_t rdata_len)
uint16_t tag = buffer.readUint16();
uint16_t algorithm = buffer.readUint8();
uint16_t digest_type = buffer.readUint8();
vector<uint8_t> digest;
rdata_len -= 4;
for (int i = 0; i < rdata_len; i++) {
digest.push_back(buffer.readUint8());
}
vector<uint8_t> digest(rdata_len);
buffer.readData(&digest[0], rdata_len);
impl_ = new DSImpl(tag, algorithm, digest_type, digest);
}
......
Supports Markdown
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