Skip to content

Commit

Permalink
statnode: boost > std optional
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Dec 13, 2024
1 parent 77bfd90 commit 0c6ee73
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-dynblocks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ void DynBlockRulesGroup::processResponseRules(counts_t& counts, StatNode& root,

if (suffixMatchRuleMatches) {
const bool hit = ringEntry.isACacheHit();
root.submit(ringEntry.name, ((ringEntry.dh.rcode == 0 && ringEntry.usec == std::numeric_limits<unsigned int>::max()) ? -1 : ringEntry.dh.rcode), ringEntry.size, hit, boost::none);
root.submit(ringEntry.name, ((ringEntry.dh.rcode == 0 && ringEntry.usec == std::numeric_limits<unsigned int>::max()) ? -1 : ringEntry.dh.rcode), ringEntry.size, hit, std::nullopt);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-lua-inspection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static void statNodeRespRing(statvisitor_t visitor, uint64_t seconds)
}

const bool hit = entry.isACacheHit();
root.submit(entry.name, ((entry.dh.rcode == 0 && entry.usec == std::numeric_limits<unsigned int>::max()) ? -1 : entry.dh.rcode), entry.size, hit, boost::none);
root.submit(entry.name, ((entry.dh.rcode == 0 && entry.usec == std::numeric_limits<unsigned int>::max()) ? -1 : entry.dh.rcode), entry.size, hit, std::nullopt);
}
}

Expand Down
4 changes: 2 additions & 2 deletions pdns/statnode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void StatNode::visit(const visitor_t& visitor, Stat& newstat, unsigned int depth
newstat += childstat;
}

void StatNode::submit(const DNSName& domain, int rcode, unsigned int bytes, bool hit, const boost::optional<const ComboAddress&>& remote)
void StatNode::submit(const DNSName& domain, int rcode, unsigned int bytes, bool hit, const std::optional<ComboAddress>& remote)
{
// cerr<<"FIRST submit called on '"<<domain<<"'"<<endl;
std::vector<string> tmp = domain.getRawLabels();
Expand All @@ -67,7 +67,7 @@ void StatNode::submit(const DNSName& domain, int rcode, unsigned int bytes, bool
www.powerdns.com.
*/

void StatNode::submit(std::vector<string>::const_iterator end, std::vector<string>::const_iterator begin, const std::string& domain, int rcode, unsigned int bytes, const boost::optional<const ComboAddress&>& remote, unsigned int count, bool hit)
void StatNode::submit(std::vector<string>::const_iterator end, std::vector<string>::const_iterator begin, const std::string& domain, int rcode, unsigned int bytes, const std::optional<ComboAddress>& remote, unsigned int count, bool hit)
{
// cerr<<"Submit called for domain='"<<domain<<"': ";
// for(const std::string& n : labels)
Expand Down
4 changes: 2 additions & 2 deletions pdns/statnode.hh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public:
std::string fullname;
uint8_t labelsCount{0};

void submit(const DNSName& domain, int rcode, unsigned int bytes, bool hit, const boost::optional<const ComboAddress&>& remote);
void submit(const DNSName& domain, int rcode, unsigned int bytes, bool hit, const std::optional<ComboAddress>& remote);
Stat print(unsigned int depth=0, Stat newstat=Stat(), bool silent=false) const;
void visit(const visitor_t& visitor, Stat& newstat, unsigned int depth = 0) const;
bool empty() const
Expand All @@ -75,5 +75,5 @@ public:
children_t children;

private:
void submit(std::vector<string>::const_iterator end, std::vector<string>::const_iterator begin, const std::string& domain, int rcode, unsigned int bytes, const boost::optional<const ComboAddress&>& remote, unsigned int count, bool hit);
void submit(std::vector<string>::const_iterator end, std::vector<string>::const_iterator begin, const std::string& domain, int rcode, unsigned int bytes, const std::optional<ComboAddress>& remote, unsigned int count, bool hit);
};

0 comments on commit 0c6ee73

Please sign in to comment.