mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 07:28:54 +00:00
Removed ldns dependency
ldns dependency was only still around for constants defined in ldns/rr.h, but those constants are RFC specified DNS constants, and to reduce deps have been replicated in dns_utils.h instead of including ldns/rr.h.
This commit is contained in:
parent
4e2b2b942d
commit
2248124453
@ -29,7 +29,6 @@
|
|||||||
#include "common/dns_utils.h"
|
#include "common/dns_utils.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <ldns/rr.h> // for RR type and class defs
|
|
||||||
#include <unbound.h>
|
#include <unbound.h>
|
||||||
|
|
||||||
namespace tools
|
namespace tools
|
||||||
@ -135,7 +134,7 @@ std::vector<std::string> DNSResolver::get_ipv4(const std::string& url)
|
|||||||
ub_result_ptr result;
|
ub_result_ptr result;
|
||||||
|
|
||||||
// call DNS resolver, blocking. if return value not zero, something went wrong
|
// call DNS resolver, blocking. if return value not zero, something went wrong
|
||||||
if (!ub_resolve(m_data->m_ub_context, urlC, LDNS_RR_TYPE_A, LDNS_RR_CLASS_IN, &(result.ptr)))
|
if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_A, DNS_CLASS_IN, &(result.ptr)))
|
||||||
{
|
{
|
||||||
if (result.ptr->havedata)
|
if (result.ptr->havedata)
|
||||||
{
|
{
|
||||||
@ -165,7 +164,7 @@ std::vector<std::string> DNSResolver::get_ipv6(const std::string& url)
|
|||||||
ub_result_ptr result;
|
ub_result_ptr result;
|
||||||
|
|
||||||
// call DNS resolver, blocking. if return value not zero, something went wrong
|
// call DNS resolver, blocking. if return value not zero, something went wrong
|
||||||
if (!ub_resolve(m_data->m_ub_context, urlC, LDNS_RR_TYPE_AAAA, LDNS_RR_CLASS_IN, &(result.ptr)))
|
if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_AAAA, DNS_CLASS_IN, &(result.ptr)))
|
||||||
{
|
{
|
||||||
if (result.ptr->havedata)
|
if (result.ptr->havedata)
|
||||||
{
|
{
|
||||||
@ -195,7 +194,7 @@ std::vector<std::string> DNSResolver::get_txt_record(const std::string& url)
|
|||||||
ub_result_ptr result;
|
ub_result_ptr result;
|
||||||
|
|
||||||
// call DNS resolver, blocking. if return value not zero, something went wrong
|
// call DNS resolver, blocking. if return value not zero, something went wrong
|
||||||
if (!ub_resolve(m_data->m_ub_context, urlC, LDNS_RR_TYPE_TXT, LDNS_RR_CLASS_IN, &(result.ptr)))
|
if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_TXT, DNS_CLASS_IN, &(result.ptr)))
|
||||||
{
|
{
|
||||||
if (result.ptr->havedata)
|
if (result.ptr->havedata)
|
||||||
{
|
{
|
||||||
|
@ -32,6 +32,12 @@
|
|||||||
namespace tools
|
namespace tools
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// RFC defines for record types and classes for DNS, gleaned from ldns source
|
||||||
|
const static int DNS_CLASS_IN = 1;
|
||||||
|
const static int DNS_TYPE_A = 1;
|
||||||
|
const static int DNS_TYPE_TXT = 6;
|
||||||
|
const static int DNS_TYPE_AAAA = 8;
|
||||||
|
|
||||||
struct DNSResolverData;
|
struct DNSResolverData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user