Skip to content

Commit

Permalink
Merge pull request #31 from dimbleby/c-ares-1.22.0
Browse files Browse the repository at this point in the history
c-ares 1.22.0
  • Loading branch information
dimbleby committed Nov 14, 2023
2 parents d3c4364 + 6c614eb commit 7e28c5f
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 8.1.0 (14 November 2023)

- c-ares 1.22.0

## 8.0.0 (11 November 2023)

- Support versions of c-ares back to 1.13.0
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "c-ares-resolver"
license = "MIT"
version = "8.0.0"
version = "8.1.0"
authors = ["David Hotham"]
description = """
An asynchronous DNS resolver, backed by c-ares.
Expand All @@ -21,7 +21,8 @@ include = [
]

[dependencies]
c-ares = { version = "8.0.0", default-features = false }
c-ares = { version = "8.1.0", default-features = false }
c-ares-sys = { version = "8.1.0", default-features = false }
futures-channel = "0.3.9"
polling = "3.1.0"

Expand Down
8 changes: 4 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ fn main() {
let version = u64::from_str_radix(&version, 16).unwrap();

if version >= 0x1_0f_00 {
// 1.15.0
println!("cargo:rustc-cfg=cares1_15");
}

if version >= 0x1_11_00 {
// 1.17.0
println!("cargo:rustc-cfg=cares1_17");
}

if version >= 0x1_13_00 {
// 1.19.0
println!("cargo:rustc-cfg=cares1_19");
}

if version >= 0x1_14_00 {
// 1.20.0
println!("cargo:rustc-cfg=cares1_20");
}

if version >= 0x1_16_00 {
println!("cargo:rustc-cfg=cares1_22");
}
}
}
7 changes: 7 additions & 0 deletions src/blockingresolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ impl BlockingResolver {
Ok(resolver)
}

/// Reinitialize a channel from system configuration.
#[cfg(cares1_22)]
pub fn reinit(&self) -> c_ares::Result<&Self> {
self.inner.reinit()?;
Ok(self)
}

/// Set the list of servers to contact, instead of the servers specified in resolv.conf or the
/// local named.
///
Expand Down
7 changes: 7 additions & 0 deletions src/futureresolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ impl FutureResolver {
Ok(resolver)
}

/// Reinitialize a channel from system configuration.
#[cfg(cares1_22)]
pub fn reinit(&self) -> c_ares::Result<&Self> {
self.inner.reinit()?;
Ok(self)
}

/// Set the list of servers to contact, instead of the servers specified in resolv.conf or the
/// local named.
///
Expand Down
29 changes: 23 additions & 6 deletions src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,30 +104,40 @@ impl Options {
self
}

/// The path to use for reading the resolv.conf file. The `resolvconf_path` should be set to a
/// path string, and will be honoured on *nix like systems. The default is /etc/resolv.conf.
/// Set the path to use for reading the resolv.conf file. The `resolvconf_path` should be set
/// to a path string, and will be honoured on *nix like systems. The default is
/// /etc/resolv.conf.
#[cfg(cares1_15)]
pub fn set_resolvconf_path(&mut self, resolvconf_path: &str) -> &mut Self {
self.inner.set_resolvconf_path(resolvconf_path);
self
}

/// The path to use for reading the hosts file. The `hosts_path` should be set to a
/// path string, and will be honoured on *nix like systems. The default is /etc/hosts.
/// Set the path to use for reading the hosts file. The `hosts_path` should be set to a path
/// string, and will be honoured on *nix like systems. The default is /etc/hosts.
#[cfg(cares1_19)]
pub fn set_hosts_path(&mut self, hosts_path: &str) -> &mut Self {
self.inner.set_hosts_path(hosts_path);
self
}

/// The maximum number of udp queries that can be sent on a single ephemeral port to a given
/// DNS server before a new ephemeral port is assigned. Any value of 0 or less will be
/// Set the maximum number of udp queries that can be sent on a single ephemeral port to a
/// given DNS server before a new ephemeral port is assigned. Any value of 0 or less will be
/// considered unlimited, and is the default.
#[cfg(cares1_20)]
pub fn set_udp_max_queries(&mut self, udp_max_queries: i32) -> &mut Self {
self.inner.set_udp_max_queries(udp_max_queries);
self
}

/// Set the upper bound for timeout between sequential retry attempts, in milliseconds. When
/// retrying queries, the timeout is increased from the requested timeout parameter, this caps
/// the value.
#[cfg(cares1_22)]
pub fn set_max_timeout(&mut self, max_timeout: i32) -> &mut Self {
self.inner.set_max_timeout(max_timeout);
self
}
}

/// An asynchronous DNS resolver, which returns results via callbacks.
Expand Down Expand Up @@ -161,6 +171,13 @@ impl Resolver {
Ok(resolver)
}

/// Reinitialize a channel from system configuration.
#[cfg(cares1_22)]
pub fn reinit(&self) -> c_ares::Result<&Self> {
self.ares_channel.lock().unwrap().reinit()?;
Ok(self)
}

/// Set the list of servers to contact, instead of the servers specified in resolv.conf or the
/// local named.
///
Expand Down

0 comments on commit 7e28c5f

Please sign in to comment.