Skip to content

Commit

Permalink
common: make this build with unbound 1.4.20
Browse files Browse the repository at this point in the history
Common on currently used distros
  • Loading branch information
moneromooo-monero committed Apr 10, 2018
1 parent 8361d60 commit a9cc88e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/dns_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ DNSResolver::DNSResolver() : m_data(new DNSResolverData())
if (use_dns_public)
{
for (const auto &ip: dns_public_addr)
ub_ctx_set_fwd(m_data->m_ub_context, ip.c_str());
ub_ctx_set_fwd(m_data->m_ub_context, string_copy(ip.c_str()));
ub_ctx_set_option(m_data->m_ub_context, string_copy("do-udp:"), string_copy("no"));
ub_ctx_set_option(m_data->m_ub_context, string_copy("do-tcp:"), string_copy("yes"));
}
Expand Down
5 changes: 4 additions & 1 deletion src/common/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,10 @@ std::string get_nix_version_display_string()
{
ub_ctx *ctx = ub_ctx_create();
if (!ctx) return false; // cheat a bit, should not happen unless OOM
ub_ctx_zone_add(ctx, "monero", "unbound"); // this calls ub_ctx_finalize first, then errors out with UB_SYNTAX
char *monero = strdup("monero"), *unbound = strdup("unbound");
ub_ctx_zone_add(ctx, monero, unbound); // this calls ub_ctx_finalize first, then errors out with UB_SYNTAX
free(unbound);
free(monero);
// if no threads, bails out early with UB_NOERROR, otherwise fails with UB_AFTERFINAL id already finalized
bool with_threads = ub_ctx_async(ctx, 1) != 0; // UB_AFTERFINAL is not defined in public headers, check any error
ub_ctx_delete(ctx);
Expand Down

0 comments on commit a9cc88e

Please sign in to comment.