Commit dd4f1216 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[3112] Avoid construction in some places

parent 9b98a012
......@@ -324,7 +324,11 @@ private:
dynamic_cast<const rdata::generic::SOA&>(*rdata).
getMinimum();
setDefaultTTL(RRTTL(ttl_val), true);
current_ttl_.reset(new RRTTL(*default_ttl_));
if (!current_ttl_) {
current_ttl_.reset(new RRTTL(*default_ttl_));
} else {
*current_ttl_ = *default_ttl_;
}
} else {
// On catching the exception we'll try to reach EOL again,
// so we need to unget it now.
......@@ -333,7 +337,11 @@ private:
"no TTL specified; load rejected");
}
} else if (!explicit_ttl && default_ttl_) {
current_ttl_.reset(new RRTTL(*default_ttl_));
if (!current_ttl_) {
current_ttl_.reset(new RRTTL(*default_ttl_));
} else {
*current_ttl_ = *default_ttl_;
}
} else if (!explicit_ttl && warn_rfc1035_ttl_) {
// Omitted (class and) TTL values are default to the last
// explicitly stated values (RFC 1035, Sec. 5.1).
......
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