summaryrefslogtreecommitdiffstats
path: root/src/lib/dns/rdata
diff options
context:
space:
mode:
authorMukund Sivaraman <muks@isc.org>2014-02-11 09:05:59 +0100
committerMukund Sivaraman <muks@isc.org>2014-02-11 09:06:01 +0100
commita6a6cb2e33f807593e6d457bfc822a9c31ef211e (patch)
tree6085fe2f3eb86c11ce6a55a327271493751e23e7 /src/lib/dns/rdata
parent[2512] Add some <character-string> tests for Value field (diff)
downloadkea-a6a6cb2e33f807593e6d457bfc822a9c31ef211e.tar.xz
kea-a6a6cb2e33f807593e6d457bfc822a9c31ef211e.zip
[2512] Use CharStringData when constructing from parameters too
This supports handling escapes and such when coming from the presentation format.
Diffstat (limited to 'src/lib/dns/rdata')
-rw-r--r--src/lib/dns/rdata/generic/caa_257.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/dns/rdata/generic/caa_257.cc b/src/lib/dns/rdata/generic/caa_257.cc
index a031ab1ede..9e6fa9bab5 100644
--- a/src/lib/dns/rdata/generic/caa_257.cc
+++ b/src/lib/dns/rdata/generic/caa_257.cc
@@ -195,9 +195,12 @@ CAA::CAA(uint8_t flags, const std::string& tag, const std::string& value) :
"CAA tag field is too large: " << tag.size());
}
+ MasterToken::StringRegion region;
+ region.beg = &value[0]; // note std ensures this works even if str is empty
+ region.len = value.size();
+
detail::CharStringData value_vec;
- value_vec.reserve(value.size());
- value_vec.insert(value_vec.end(), value.begin(), value.end());
+ detail::stringToCharStringData(region, value_vec);
impl_ = new CAAImpl(flags, tag, value_vec);
}