pcp: make the ToString method const

This commit is contained in:
Antoine Poinsot committed 2025-02-12 10:31:43 -05:00
1 parent ede388d03d
commit 01906ce912
2 files changed
+2 -2

No files matched your search

+1 -1
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)",
+1 -1
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.