switch(len & 3)
{
case 3: k1 ^= tail[2] << 16;
+ /* fallthrough */
case 2: k1 ^= tail[1] << 8;
+ /* fallthrough */
case 1: k1 ^= tail[0];
k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
};
d_result = SQLFetch(d_statement);
// cerr<<"subsequent SQLFetch done, d_result="<<d_result<<endl;
if(d_result == SQL_NO_DATA) {
- SQLRETURN result = SQLMoreResults(d_statement);
- // cerr<<"SQLMoreResults done, result="<<d_result<<endl;
- if (result == SQL_NO_DATA) {
- d_result = result;
+ SQLRETURN result2 = SQLMoreResults(d_statement);
+ // cerr<<"SQLMoreResults done, result="<<d_result2<<endl;
+ if (result2 == SQL_NO_DATA) {
+ d_result = result2;
}
else {
- testResult( result, SQL_HANDLE_STMT, d_statement, "Could not fetch next result set for ("+d_query+").");
+ testResult( result2, SQL_HANDLE_STMT, d_statement, "Could not fetch next result set for ("+d_query+").");
d_result = SQLFetch(d_statement);
}
}
// TTL
if ( d_result.count( "PdnsRecordTTL" ) && !d_result["PdnsRecordTTL"].empty() ) {
for ( const auto& rdata : d_result["PdnsRecordTTL"] ) {
- std::string qtype;
+ std::string qtype2;
std::size_t pos = rdata.find_first_of( '|', 0 );
if ( pos == std::string::npos )
continue;
- qtype = rdata.substr( 0, pos );
- if ( qtype != QType( local_result.qtype ).getName() )
+ qtype2 = rdata.substr( 0, pos );
+ if ( qtype2 != QType( local_result.qtype ).getName() )
continue;
local_result.ttl = pdns_stou( rdata.substr( pos + 1 ) );
std::string defaultOrdername;
for ( const auto& rdata : d_result["PdnsRecordOrdername"] ) {
- std::string qtype;
+ std::string qtype2;
std::size_t pos = rdata.find_first_of( '|', 0 );
if ( pos == std::string::npos ) {
// This is the default ordername for all records in this entry
continue;
}
- qtype = rdata.substr( 0, pos );
- if ( qtype != QType( local_result.qtype ).getName() )
+ qtype2 = rdata.substr( 0, pos );
+ if ( qtype2 != QType( local_result.qtype ).getName() )
continue;
local_result.ordername = rdata.substr( pos + 1 );
DomainInfo di=*iter;
di.id = iter.getID();
- auto txn = getRecordsROTransaction(iter.getID());
- if(!txn->txn.get(txn->db->dbi, co(di.id, g_rootdnsname, QType::SOA), val)) {
+ auto txn2 = getRecordsROTransaction(iter.getID());
+ if(!txn2->txn.get(txn2->db->dbi, co(di.id, g_rootdnsname, QType::SOA), val)) {
DNSResourceRecord rr;
serFromString(val.get<string_view>(), rr);
if(!txn2->txn.get(txn2->db->dbi, co(iter.getID(), g_rootdnsname, QType::SOA), val)) {
DNSResourceRecord rr;
serFromString(val.get<string_view>(), rr);
- struct soatimes
- {
- uint32_t serial;
- uint32_t refresh;
- uint32_t retry;
- uint32_t expire;
- uint32_t minimum;
- } st;
-
+ struct soatimes st;
+
memcpy(&st, &rr.content[rr.content.size()-sizeof(soatimes)], sizeof(soatimes));
if((time_t)(iter->last_check + ntohl(st.refresh)) >= now) { // still fresh
KeyDataDB kdb;
if(txn.get(id, kdb)) {
if(kdb.domain == name) {
- txn.modify(id, [](KeyDataDB& kdb)
+ txn.modify(id, [](KeyDataDB& kdbarg)
{
- kdb.active = true;
+ kdbarg.active = true;
});
txn.commit();
return true;
KeyDataDB kdb;
if(txn.get(id, kdb)) {
if(kdb.domain == name) {
- txn.modify(id, [](KeyDataDB& kdb)
+ txn.modify(id, [](KeyDataDB& kdbarg)
{
- kdb.active = false;
+ kdbarg.active = false;
});
txn.commit();
return true;
g_log<<Logger::Notice<<"Wrote zonedata for "<<domain<<" with serial "<<soa->d_st.serial<<" to "<<dir<<endl;
const auto oldZoneInfo = getCurrentZoneInfo(domain);
- auto zoneInfo = std::make_shared<ixfrinfo_t>();
+ auto ixfrInfo = std::make_shared<ixfrinfo_t>();
if (oldZoneInfo && !oldZoneInfo->latestAXFR.empty()) {
auto diff = std::make_shared<ixfrdiff_t>();
- zoneInfo->ixfrDiffs = oldZoneInfo->ixfrDiffs;
+ ixfrInfo->ixfrDiffs = oldZoneInfo->ixfrDiffs;
g_log<<Logger::Debug<<"Calculating diff for "<<domain<<endl;
makeIXFRDiff(oldZoneInfo->latestAXFR, records, diff, oldZoneInfo->soa, oldZoneInfo->soaTTL, soa, soaTTL);
g_log<<Logger::Debug<<"Calculated diff for "<<domain<<", we had "<<diff->removals.size()<<" removals and "<<diff->additions.size()<<" additions"<<endl;
- zoneInfo->ixfrDiffs.push_back(std::move(diff));
+ ixfrInfo->ixfrDiffs.push_back(std::move(diff));
}
// Clean up the diffs
- while (zoneInfo->ixfrDiffs.size() > keep) {
- zoneInfo->ixfrDiffs.erase(zoneInfo->ixfrDiffs.begin());
+ while (ixfrInfo->ixfrDiffs.size() > keep) {
+ ixfrInfo->ixfrDiffs.erase(ixfrInfo->ixfrDiffs.begin());
}
g_log<<Logger::Debug<<"Zone "<<domain<<" previously contained "<<(oldZoneInfo ? oldZoneInfo->latestAXFR.size() : 0)<<" entries, "<<records.size()<<" now"<<endl;
- zoneInfo->latestAXFR = std::move(records);
- zoneInfo->soa = soa;
- zoneInfo->soaTTL = soaTTL;
- updateCurrentZoneInfo(domain, zoneInfo);
+ ixfrInfo->latestAXFR = std::move(records);
+ ixfrInfo->soa = soa;
+ ixfrInfo->soaTTL = soaTTL;
+ updateCurrentZoneInfo(domain, ixfrInfo);
} catch (PDNSException &e) {
g_stats.incrementAXFRFailures(domain);
g_log<<Logger::Warning<<"Could not save zone '"<<domain<<"' to disk: "<<e.reason<<endl;
lci.negAnchors.clear();
});
- Lua.writeFunction("readTrustAnchorsFromFile", [&lci](const std::string& fname, const boost::optional<uint32_t> interval) {
+ Lua.writeFunction("readTrustAnchorsFromFile", [&lci](const std::string& fnamearg, const boost::optional<uint32_t> interval) {
uint32_t realInterval = 24;
if (interval) {
realInterval = static_cast<uint32_t>(*interval);
}
warnIfDNSSECDisabled("Warning: reading Trust Anchors from file (readTrustAnchorsFromFile), but dnssec is set to 'off'!");
- lci.trustAnchorFileInfo.fname = fname;
+ lci.trustAnchorFileInfo.fname = fnamearg;
lci.trustAnchorFileInfo.interval = realInterval;
- updateTrustAnchorsFromFile(fname, lci.dsAnchors);
+ updateTrustAnchorsFromFile(fnamearg, lci.dsAnchors);
});
#if HAVE_PROTOBUF
// Keeps additional information about metrics
struct MetricDefinition {
- MetricDefinition(const PrometheusMetricType& prometheusType, const std::string& description) {
- this->prometheusType = prometheusType;
- this->description = description;
+ MetricDefinition(const PrometheusMetricType& prometheusType_, const std::string& description_) {
+ prometheusType = prometheusType_;
+ description = description_;
}
MetricDefinition() = default;
smt.remove(net);
size_t count = 0;
- smt.visit([apowerdnscom, &count](const SuffixMatchTree<DNSName>& smt) {
+ smt.visit([apowerdnscom, &count](const SuffixMatchTree<DNSName>& smtarg) {
count++;
- BOOST_CHECK_EQUAL(smt.d_value, apowerdnscom);
+ BOOST_CHECK_EQUAL(smtarg.d_value, apowerdnscom);
});
BOOST_CHECK_EQUAL(count, 1U);
BOOST_CHECK(smt.lookup(apowerdnscom) == nullptr);
count = 0;
- smt.visit([&count](const SuffixMatchTree<DNSName>& smt) {
+ smt.visit([&count](const SuffixMatchTree<DNSName>&) {
count++;
});
BOOST_CHECK_EQUAL(count, 0U);
class HttpRequest : public YaHTTP::Request {
public:
- HttpRequest(const string& logprefix="") : YaHTTP::Request(), accept_json(false), accept_html(false), complete(false), logprefix(logprefix) { };
+ HttpRequest(const string& logprefix_="") : YaHTTP::Request(), accept_json(false), accept_html(false), complete(false), logprefix(logprefix_) { };
bool accept_json;
bool accept_html;
static void prometheusMetrics(HttpRequest *req, HttpResponse *resp) {
- static MetricDefinitionStorage g_metricDefinitions;
+ static MetricDefinitionStorage s_metricDefinitions;
if (req->method != "GET")
throw HttpMethodNotAllowedException();
MetricDefinition metricDetails;
- if (g_metricDefinitions.getMetricDetails(metricName, metricDetails)) {
- std::string prometheusTypeName = g_metricDefinitions.getPrometheusStringMetricType(
+ if (s_metricDefinitions.getMetricDetails(metricName, metricDetails)) {
+ std::string prometheusTypeName = s_metricDefinitions.getPrometheusStringMetricType(
metricDetails.prometheusType);
if (prometheusTypeName.empty()) {