if (!logger && !(dnsdist::configuration::yaml::s_inClientMode || dnsdist::configuration::yaml::s_inConfigCheckMode)) {
throw std::runtime_error("Unable to find the protobuf logger named '" + std::string(logger_name) + "'");
}
- loggers.push_back(logger);
+ loggers.push_back(std::move(logger));
}
dnsdist::actions::SetTraceActionConfiguration actionConfig{
loggers.push_back(remote_logger.second);
}
}
- config.remote_loggers = loggers;
+ config.remote_loggers = std::move(loggers);
}
config.value = value;
config.trace_edns_option = trace_edns_option.value_or(65500);
}
ede.clearExisting = clearExistingEntries.value_or(true);
if (ede.clearExisting) {
- dnsResponse.ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({ede}));
+ dnsResponse.ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({std::move(ede)}));
}
else {
if (!dnsResponse.ids.d_extendedErrors) {
- dnsResponse.ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({ede}));
+ dnsResponse.ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({std::move(ede)}));
}
else {
- dnsResponse.ids.d_extendedErrors->emplace_back(ede);
+ dnsResponse.ids.d_extendedErrors->emplace_back(std::move(ede));
}
}
});
ede.error.extraText = std::string(extraText, extraTextSize);
}
ede.clearExisting = true;
- dnsQuestion->dq->ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({ede}));
+ dnsQuestion->dq->ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({std::move(ede)}));
}
void dnsdist_ffi_dnsquestion_add_extended_dns_error(dnsdist_ffi_dnsquestion_t* dnsQuestion, uint16_t infoCode, const char* extraText, size_t extraTextSize)
}
ede.clearExisting = false;
if (!dnsQuestion->dq->ids.d_extendedErrors) {
- dnsQuestion->dq->ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({ede}));
+ dnsQuestion->dq->ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({std::move(ede)}));
}
else {
dnsQuestion->dq->ids.d_extendedErrors->emplace_back(ede);
}
if (dnsResponse.ids.d_extendedErrors) {
- for (auto ede : *dnsResponse.ids.d_extendedErrors) {
+ for (const auto& ede : *dnsResponse.ids.d_extendedErrors) {
dnsdist::edns::addExtendedDNSError(dnsResponse.getMutableData(), dnsResponse.getMaximumSize(), ede);
}
}
}
if (dnsResponse.ids.d_extendedErrors) {
- for (auto ede : *dnsResponse.ids.d_extendedErrors) {
+ for (const auto& ede : *dnsResponse.ids.d_extendedErrors) {
dnsdist::edns::addExtendedDNSError(dnsResponse.getMutableData(), dnsResponse.getMaximumSize(), ede);
}
}
}
if (dnsResponse.ids.d_extendedErrors) {
- for (auto ede : *dnsResponse.ids.d_extendedErrors) {
+ for (const auto& ede : *dnsResponse.ids.d_extendedErrors) {
dnsdist::edns::addExtendedDNSError(dnsResponse.getMutableData(), dnsResponse.getMaximumSize(), ede);
}
}