pcp: make the ToString method const

This commit is contained in:
Antoine Poinsot 2025-01-16 14:43:06 -05:00
parent ede388d03d
commit 01906ce912
2 changed files with 2 additions and 2 deletions

View file

@ -512,7 +512,7 @@ std::variant<MappingResult, MappingError> PCPRequestPortMap(const PCPMappingNonc
return MappingResult(PCP_VERSION, CService(internal, port), CService(external_addr, external_port), lifetime_ret);
}
std::string MappingResult::ToString()
std::string MappingResult::ToString() const
{
Assume(version == NATPMP_VERSION || version == PCP_VERSION);
return strprintf("%s:%s -> %s (for %ds)",

View file

@ -40,7 +40,7 @@ struct MappingResult {
uint32_t lifetime;
//! Format mapping as string for logging.
std::string ToString();
std::string ToString() const;
};
//! Try to open a port using RFC 6886 NAT-PMP. IPv4 only.