mirror of
https://github.com/matrix-construct/construct
synced 2024-07-06 10:38:37 +02:00
ircd::net: Include a remote::resolved() indicator.
This commit is contained in:
parent
1bc4b46fbd
commit
bf9db52428
|
@ -123,6 +123,7 @@ struct ircd::net::remote
|
|||
|
||||
operator bool() const;
|
||||
bool operator!() const { return !static_cast<bool>(*this); }
|
||||
bool resolved() const;
|
||||
|
||||
remote(std::string hostname, const std::string &port);
|
||||
remote(std::string hostname, const uint16_t &port);
|
||||
|
@ -137,11 +138,18 @@ struct ircd::net::remote
|
|||
friend std::ostream &operator<<(std::ostream &, const remote &);
|
||||
};
|
||||
|
||||
inline bool
|
||||
ircd::net::remote::resolved()
|
||||
const
|
||||
{
|
||||
return bool(static_cast<const ipport &>(*this));
|
||||
}
|
||||
|
||||
inline ircd::net::remote::operator
|
||||
bool()
|
||||
const
|
||||
{
|
||||
return bool(static_cast<const ipport &>(*this)) || !hostname.empty();
|
||||
return resolved() || !hostname.empty();
|
||||
}
|
||||
|
||||
inline
|
||||
|
|
Loading…
Reference in a new issue