mirror of
https://github.com/monero-project/monero.git
synced 2025-08-13 17:15:41 -04:00
common: DNSResolver can handle hostnames without dot characters
Unrelated, but similar code-wise to #8643. There is a check in `DNSResolver` which automatically fails to resolve hostnames which do not contain the `.` character. This PR removes that check.
This commit is contained in:
parent
365fd45b03
commit
8687da6276
3 changed files with 11 additions and 24 deletions
|
@ -326,11 +326,6 @@ std::vector<std::string> DNSResolver::get_record(const std::string& url, int rec
|
|||
dnssec_available = false;
|
||||
dnssec_valid = false;
|
||||
|
||||
if (!check_address_syntax(url.c_str()))
|
||||
{
|
||||
return addresses;
|
||||
}
|
||||
|
||||
// destructor takes care of cleanup
|
||||
ub_result_ptr result;
|
||||
|
||||
|
@ -413,16 +408,6 @@ DNSResolver DNSResolver::create()
|
|||
return DNSResolver();
|
||||
}
|
||||
|
||||
bool DNSResolver::check_address_syntax(const char *addr) const
|
||||
{
|
||||
// if string doesn't contain a dot, we won't consider it a url for now.
|
||||
if (strchr(addr,'.') == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace dns_utils
|
||||
{
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue