return true;
}
return d_mapFormat == BPFFilter::MapFormat::WithActions;
-#endif /* HAVE_EBPF */
+#else
(void)action;
return false;
+#endif /* HAVE_EBPF */
}
bool BPFFilter::isExternal() const
return empty;
}
+ // coverity[auto_causes_copy]
return *dnsQuestion.ids.qTag;
});
luaCtx.registerFunction<LuaAssociativeTable<std::string> (DNSQuestion::*)(void) const>("getHTTPHeaders", [](const DNSQuestion& dnsQuestion) {
if (dnsQuestion.ids.du) {
+ // coverity[auto_causes_copy]
return dnsQuestion.ids.du->getHTTPHeaders();
}
if (dnsQuestion.ids.doh3u) {
+ // coverity[auto_causes_copy]
return dnsQuestion.ids.doh3u->getHTTPHeaders();
}
return LuaAssociativeTable<std::string>();
for (const auto& entry : histo) {
int stars = static_cast<int>(70.0 * entry.second / highest);
char value = '*';
- if (stars == 0 && entry.second != 0) {
+ if (stars == 0 && entry.second != 0 && highest != 0.0) {
stars = 1; // you get 1 . to show something is there..
if (70.0 * entry.second / highest > 0.5) {
value = ':';
auto subject = rules[from];
rules.erase(rules.begin() + from);
if (destination > rules.size()) {
- rules.push_back(subject);
+ rules.push_back(std::move(subject));
}
else {
if (from < destination) {
if (getOptionalValue<decltype(customResponseHeaders)>(vars, "customResponseHeaders", customResponseHeaders) > 0) {
for (auto const& headerMap : customResponseHeaders) {
auto headerResponse = std::pair(boost::to_lower_copy(headerMap.first), headerMap.second);
- frontend->d_customResponseHeaders.insert(headerResponse);
+ frontend->d_customResponseHeaders.insert(std::move(headerResponse));
}
}
checkAllParametersConsumed("declareMetric", vars);
}
}
- auto result = dnsdist::metrics::declareCustomMetric(name, type, description, customName, withLabels);
+ auto result = dnsdist::metrics::declareCustomMetric(name, type, description, std::move(customName), withLabels);
if (result) {
g_outputBuffer += *result + "\n";
errlog("Error in declareMetric: %s", *result);
auto metricEntry = metricEntries.find(combinationOfLabels);
if (metricEntry == metricEntries.end()) {
metricEntry = metricEntries.emplace(std::piecewise_construct, std::forward_as_tuple(combinationOfLabels), std::forward_as_tuple()).first;
- g_stats.entries.write_lock()->emplace_back(Stats::EntryTriple{std::string(name), combinationOfLabels, &metricEntry->second.d_value});
+ g_stats.entries.write_lock()->emplace_back(Stats::EntryTriple{std::string(name), std::move(combinationOfLabels), &metricEntry->second.d_value});
}
return metricEntry->second;
}
if (!typeIt->d_caseSensitive) {
boost::algorithm::to_lower(variable);
}
- d_subKey = variable;
+ d_subKey = std::move(variable);
}
return;
}
auto tag = key;
tag.append(":");
tag.append(value);
- result.push_back(tag);
+ result.push_back(std::move(tag));
}
}
return result;