Skip to content

Commit

Permalink
PCBC-985: use system DNS config by default (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
avsej authored Apr 4, 2024
1 parent fcae782 commit d04dd33
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/wrapper/connection_handle.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4827,9 +4827,9 @@ connection_handle::cluster() const
}

struct dns_options {
std::chrono::milliseconds timeout{ core::timeout_defaults::dns_srv_timeout };
std::string nameserver{ core::io::dns::dns_config::default_nameserver };
std::uint16_t port{ core::io::dns::dns_config::default_port };
std::chrono::milliseconds timeout;
std::string nameserver;
std::uint16_t port;
};

static core_error_info
Expand All @@ -4842,7 +4842,8 @@ apply_options(core::utils::connection_string& connstr, zval* options)
const zend_string* key;
const zval* value;

dns_options dns{};
auto system_dns = core::io::dns::dns_config::system_config();
dns_options dns{ system_dns.timeout(), system_dns.nameserver(), system_dns.port() };

ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(options), key, value)
{
Expand Down

0 comments on commit d04dd33

Please # to comment.