Skip to content

Commit

Permalink
release 8.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed May 26, 2024
1 parent ea823e2 commit 0471980
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 2 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.5.0 (26 May 2024)

- add `get_servers()`

## 8.4.0 (24 May 2024)

- cares 1.29.0
Expand Down
4 changes: 2 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.4.0"
version = "8.5.0"
authors = ["David Hotham"]
description = """
An asynchronous DNS resolver, backed by c-ares.
Expand All @@ -21,7 +21,7 @@ include = [
]

[dependencies]
c-ares = { version = "9.1.0", default-features = false }
c-ares = { version = "9.2.0", default-features = false }
c-ares-sys = { version = "9.2.0", default-features = false }
futures-channel = "0.3.9"
polling = "3.1.0"
Expand Down
5 changes: 5 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ fn main() {
println!("cargo:rustc-cfg=cares1_23");
}

println!("cargo::rustc-check-cfg=cfg(cares1_24)");
if version >= 0x1_18_00 {
println!("cargo:rustc-cfg=cares1_24");
}

println!("cargo::rustc-check-cfg=cfg(cares1_29)");
if version >= 0x1_1d_00 {
println!("cargo:rustc-cfg=cares1_29");
Expand Down
9 changes: 9 additions & 0 deletions src/blockingresolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ use crate::host::HostResults;
use crate::nameinfo::NameInfoResult;
use crate::resolver::{Options, Resolver};

#[cfg(cares1_24)]
use c_ares::AresString;

#[cfg(cares1_29)]
use c_ares::ServerStateFlags;

Expand Down Expand Up @@ -56,6 +59,12 @@ impl BlockingResolver {
Ok(self)
}

/// Retrieves the list of servers in comma delimited format.
#[cfg(cares1_24)]
pub fn get_servers(&self) -> AresString {
self.inner.get_servers()
}

/// Set the local IPv4 address from which to make queries.
pub fn set_local_ipv4(&self, ipv4: Ipv4Addr) -> &Self {
self.inner.set_local_ipv4(ipv4);
Expand Down
9 changes: 9 additions & 0 deletions src/futureresolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ use crate::host::HostResults;
use crate::nameinfo::NameInfoResult;
use crate::resolver::{Options, Resolver};

#[cfg(cares1_24)]
use c_ares::AresString;

#[cfg(cares1_29)]
use c_ares::ServerStateFlags;

Expand Down Expand Up @@ -101,6 +104,12 @@ impl FutureResolver {
Ok(self)
}

/// Retrieves the list of servers in comma delimited format.
#[cfg(cares1_24)]
pub fn get_servers(&self) -> AresString {
self.inner.get_servers()
}

/// Set the local IPv4 address from which to make queries.
pub fn set_local_ipv4(&self, ipv4: Ipv4Addr) -> &Self {
self.inner.set_local_ipv4(ipv4);
Expand Down
9 changes: 9 additions & 0 deletions src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use std::sync::{Arc, Mutex};
use crate::error::Error;
use crate::eventloop::{EventLoop, EventLoopStopper};

#[cfg(cares1_24)]
use c_ares::AresString;

#[cfg(cares1_29)]
use c_ares::{ServerFailoverOptions, ServerStateFlags};

Expand Down Expand Up @@ -223,6 +226,12 @@ impl Resolver {
Ok(self)
}

/// Retrieves the list of servers in comma delimited format.
#[cfg(cares1_24)]
pub fn get_servers(&self) -> AresString {
self.ares_channel.lock().unwrap().get_servers()
}

/// Set the local IPv4 address from which to make queries.
pub fn set_local_ipv4(&self, ipv4: Ipv4Addr) -> &Self {
self.ares_channel.lock().unwrap().set_local_ipv4(ipv4);
Expand Down

0 comments on commit 0471980

Please sign in to comment.