bbd->d_status = "parsed into memory at " + nowTime();
bbd->d_records = LookButDontTouch<recordstorage_t>(std::move(records));
bbd->d_nsec3zone = nsec3zone;
- bbd->d_nsec3param = ns3pr;
+ bbd->d_nsec3param = std::move(ns3pr);
}
/** THIS IS AN INTERNAL FUNCTION! It does moadnsparser prio impedance matching
DNSName name = ri->qname.empty() ? i.d_name : (ri->qname + i.d_name);
if (sm.match(name) || sm.match(ri->content)) {
DNSResourceRecord r;
- r.qname = name;
+ r.qname = std::move(name);
r.domain_id = i.d_id;
r.content = ri->content;
r.qtype = ri->qtype;
throw PDNSException(string("%mp is not allowed in mapping lookup formats of domain ") + dom.domain.toLogString());
}
- dom.mapping_lookup_formats = mapping_lookup_formats;
+ dom.mapping_lookup_formats = std::move(mapping_lookup_formats);
}
else {
dom.mapping_lookup_formats = d_global_mapping_lookup_formats;
break;
}
- if (!found || val.empty() || val == "--")
+ if (!found || val.empty() || val == "--") {
continue; // try next database
- ret = val;
+ }
+ ret = std::move(val);
std::transform(ret.begin(), ret.end(), ret.begin(), ::tolower);
break;
}
if (!d_result.empty()) {
// collect all IP addresses
vector<ComboAddress> tmp;
- for(const auto& row: d_result) {
- if (account == row[1])
+ for (const auto& row: d_result) {
+ if (account == row[1]) {
tmp.emplace_back(row[0], 53);
+ }
}
// set them as domain's primaries, comma separated
- primaries = tmp;
+ primaries = std::move(tmp);
}
}
createDomain(domain, DomainInfo::Secondary, primaries, account);
if (!cred->valid()) {
throw PDNSException("Invalid credential " + cred->d_nameS);
}
- d_cred = cred;
+ d_cred = std::move(cred);
}
~GssSecContext()
g_log<<Logger::Debug<<"Zone "<<domain<<" previously contained "<<(oldZoneInfo ? oldZoneInfo->latestAXFR.size() : 0)<<" entries, "<<records.size()<<" now"<<endl;
ixfrInfo->latestAXFR = std::move(records);
- ixfrInfo->soa = soa;
+ ixfrInfo->soa = std::move(soa);
ixfrInfo->soaTTL = soaTTL;
updateCurrentZoneInfo(domain, ixfrInfo);
} catch (PDNSException &e) {
}
}
- auto trueTarget = target.isRoot() ? name : target;
+ const auto& trueTarget = target.isRoot() ? name : target;
if (prio > 0) {
if(v4hintsAuto && arecords.find(trueTarget) == arecords.end()) {
cout << "[warning] SVCB record for "<< name << " has automatic IPv4 hints, but no A-record for the target at "<< trueTarget <<" exists."<<endl;
{
if (maxConnectionDuration) {
time_t elapsed = time(nullptr) - start;
- if (elapsed >= maxConnectionDuration) {
+ if (elapsed > 0 && elapsed >= maxConnectionDuration) {
return true;
}
- remainingTime = maxConnectionDuration - elapsed;
+ remainingTime = static_cast<unsigned int >(maxConnectionDuration - elapsed);
}
return false;
}
resourceRecord.dr.d_ttl = soaData->ttl;
resourceRecord.domain_id = soaData->domain_id;
- addCache(d_question, {resourceRecord});
+ addCache(d_question, {std::move(resourceRecord)});
}
}
struct TSIGKey tsk;
tsk.name = keyname;
tsk.algorithm = algo;
- tsk.key = content;
+ tsk.key = std::move(content);
if (req->method == "GET") {
resp->setJsonBody(makeJSONTSIGKey(tsk));
if (B64Decode(new_content, decoded) == -1) {
throw ApiException("Can not base64 decode key content '" + new_content + "'");
}
- tsk.key = new_content;
+ tsk.key = std::move(new_content);
}
if (!B.setTSIGKey(tsk.name, tsk.algorithm, tsk.key)) {
throw HttpInternalServerErrorException("Unable to save TSIG Key");