dns: make ctor private

This ensures one can't instanciate a DNSResolver object by
mistake, but uses the singleton. A separate create static
function is added for cases where a new object is explicitely
needed.
This commit is contained in:
moneromooo-monero 2015-08-27 21:06:09 +01:00
parent a1af0feb06
commit 5990344cb0
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
3 changed files with 21 additions and 7 deletions

View file

@ -334,6 +334,11 @@ DNSResolver& DNSResolver::instance()
return *staticInstance;
}
DNSResolver DNSResolver::create()
{
return DNSResolver();
}
bool DNSResolver::check_address_syntax(const char *addr)
{
// if string doesn't contain a dot, we won't consider it a url for now.