throw std::out_of_range("Attempt to print an unset dnsname");
}
+ if(isRoot())
+ return trailing ? separator : "";
+
std::string ret;
for(const auto& s : getRawLabels()) {
ret+= escapeLabel(s) + separator;
}
- if(ret.empty())
- return trailing ? separator : "";
return ret.substr(0, ret.size()-!trailing);
}
{
DNSName ret(*this);
ret.makeUsRelative(zone);
- return ret;
+ return ret.empty() ? zone : ret; // HACK FIXME400
}
void DNSName::makeUsRelative(const DNSName& zone)
{
bool DNSName::isWildcard() const
{
- if(d_storage.empty())
+ if(d_storage.size() < 2)
return false;
auto p = d_storage.begin();
return (*p == 0x01 && *++p == '*');
signQName= DNSName(toLower(pos->qname.toString()));
if(!pos->wildcardname.empty())
wildcardQName = DNSName(toLower(pos->wildcardname.toString()));
+ else
+ wildcardQName.clear();
signQType = pos ->qtype.getCode();
if(pos->signttl)
signTTL = pos->signttl;