Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCBC-985: use system DNS config by default #159

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading