free(result);
gl.netmask = tmp_gl.netmask;
// reduce space to dash
- ret = boost::replace_all_copy(ret, " ", "-");
+ std::replace(ret.begin(), ret.end(), ' ', '-');
return true;
}
}
free(result);
gl.netmask = tmp_gl.netmask;
// reduce space to dash
- ret = boost::replace_all_copy(ret, " ", "-");
+ std::replace(ret.begin(), ret.end(), ' ', '-');
return true;
}
}
};
auto lower = boost::to_lower_copy(str);
- boost::replace_all(lower, "-", "");
+ lower.erase(std::remove(lower.begin(), lower.end(), '-'), lower.end());
auto mappingIt = s_mappings.find(lower);
if (mappingIt != s_mappings.end()) {
return mappingIt->second;
for (const auto& state : dnsdist::configuration::getCurrentRuntimeConfiguration().d_backends) {
string serverName = state->getName().empty() ? state->d_config.remote.toStringWithPort() : state->getName();
- boost::replace_all(serverName, ".", "_");
+ std::replace(serverName.begin(), serverName.end(), '.', '_');
string base = namespace_name;
base += ".";
base += hostname;
}
string frontName = front->local.toStringWithPort() + (front->udpFD >= 0 ? "_udp" : "_tcp");
- boost::replace_all(frontName, ".", "_");
+ std::replace(frontName.begin(), frontName.end(), '.', '_');
auto dupPair = frontendDuplicates.insert({frontName, 1});
if (!dupPair.second) {
frontName += "_" + std::to_string(dupPair.first->second);
for (const auto& entry : dnsdist::configuration::getCurrentRuntimeConfiguration().d_pools) {
string poolName = entry.first;
- boost::replace_all(poolName, ".", "_");
+ std::replace(poolName.begin(), poolName.end(), '.', '_');
if (poolName.empty()) {
poolName = "_default_";
}
const string base = "dnsdist." + hostname + ".main.doh.";
for (const auto& doh : dnsdist::getDoHFrontends()) {
string name = doh->d_tlsContext.d_addr.toStringWithPort();
- boost::replace_all(name, ".", "_");
- boost::replace_all(name, ":", "_");
- boost::replace_all(name, "[", "_");
- boost::replace_all(name, "]", "_");
+ std::replace(name.begin(), name.end(), '.', '_');
+ std::replace(name.begin(), name.end(), ':', '_');
+ std::replace(name.begin(), name.end(), '[', '_');
+ std::replace(name.begin(), name.end(), ']', '_');
auto dupPair = dohFrontendDuplicates.insert({name, 1});
if (!dupPair.second) {
auto records = dnsdist::QueryCount::g_queryCountRecords.write_lock();
for (const auto& record : *records) {
qname = record.first;
- boost::replace_all(qname, ".", "_");
+ std::replace(qname.begin(), qname.end(), '.', '_');
str << "dnsdist.querycount." << qname << ".queries " << record.second << " " << now << "\r\n";
}
records->clear();
queriedName += '.';
}
- boost::replace_all(queriedName, "+", "_");
- boost::replace_all(queriedName, "~", "_");
+ std::replace(queriedName.begin(), queriedName.end(), '+', '_');
+ std::replace(queriedName.begin(), queriedName.end(), '~', '_');
try {
std::string status = getSecPollStatus(queriedName);
serverName = state->getName();
}
- boost::replace_all(serverName, ".", "_");
+ std::replace(serverName.begin(), serverName.end(), '.', '_');
const std::string label = boost::str(boost::format(R"({server="%1%",address="%2%"})")
% serverName % state->d_config.remote.toStringWithPort());
if (pos != string::npos) {
// need to base64url decode this
string sdns(path.substr(pos+5));
- boost::replace_all(sdns,"-", "+");
- boost::replace_all(sdns,"_", "/");
+ std::replace(sdns.begin(), sdns.end(), '-', '+');
+ std::replace(sdns.begin(), sdns.end(), '_', '/');
// re-add padding that may have been missing
switch (sdns.size() % 4) {
case 2:
vector<ComboAddress> candidates;
// Getting something like 192-0-2-1.192-0-2-2.198-51-100-1.example.org
for(auto l : s_lua_record_ctx->qname.getRawLabels()) {
- boost::replace_all(l, "-", ".");
+ std::replace(l.begin(), l.end(), '-', '.');
try {
candidates.emplace_back(l);
} catch (const PDNSException& e) {
}
else if(parts.size()==1) {
if (parts[0].find('-') != std::string::npos) {
- boost::replace_all(parts[0],"-",":");
+ std::replace(parts[0].begin(), parts[0].end(), '-', ':');
ComboAddress ca(parts[0]);
return ca.toString();
} else {
}
string dashed=ip6.toString();
- boost::replace_all(dashed, ":", "-");
+ std::replace(dashed.begin(), dashed.end(), ':', '-');
for(int i=31; i>=0; --i)
fmt % labels[i];
throw std::runtime_error(stringerror());
}
- boost::replace_all(*hostname, ".", "_");
+ std::replace(hostname->begin(), hostname->end(), '.', '_');
return *hostname;
}
qstring += '.';
}
- boost::replace_all(qstring, "+", "_");
- boost::replace_all(qstring, "~", "_");
+ std::replace(qstring.begin(), qstring.end(), '+', '_');
+ std::replace(qstring.begin(), qstring.end(), '~', '_');
vState state = vState::Indeterminate;
DNSName query(qstring);
if(*query.rbegin()!='.')
query+='.';
- boost::replace_all(query, "+", "_");
- boost::replace_all(query, "~", "_");
+ std::replace(query.begin(), query.end(), '+', '_');
+ std::replace(query.begin(), query.end(), '~', '_');
int security_status = std::stoi(S.getValueStr("security-status"));
BOOST_CHECK_EQUAL(gethostname(buffer, sizeof buffer), 0);
std::string my_hostname(buffer);
- boost::replace_all(my_hostname, ".", "_");
+ std::replace(my_hostname.begin(), my_hostname.end(), '.', '_');
std::string hostname = getCarbonHostName();
// ensure it matches what we get