Skip to content

Commit

Permalink
Merge pull request #74 from bluejekyll/0.9.0_release
Browse files Browse the repository at this point in the history
0.9.0 release
  • Loading branch information
bluejekyll committed Dec 17, 2016
2 parents 3dcb9e0 + 616ebae commit 65f7ae0
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 46 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## unreleased (0.9.0)
## 0.9.0
### Added
- new ServerFuture tokio and futures based server, #61
- UdpStream & TcpSteam to support stream of messages with src address
- TimeoutStream to wrap TcpStreams to help guard against malicious clients
- Added Notify support to ClientFuture
- Added IntoRecordSet and conversion impls for RecordSet and Record

### Changed
- Split Server and Client into separate crates, #43
- Moved many integration tests to `tests` from `src`, #52
- Migrated all handles to new futures::sync::mpsc impls
- Modified all requisite client methods for IntoRecordSet.
- All client methods now support multiple records per query, update, notify and delete

### Fixed
- Flush TcpStream after fully sending Message
Expand Down
77 changes: 38 additions & 39 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trust-dns"
version = "0.8.1"
version = "0.9.0"
authors = ["Benjamin Fry <benjaminfry@me.com>"]

# A short blurb about the package. This is not rendered in any format when
Expand Down Expand Up @@ -56,6 +56,3 @@ rand = "^0.3"
rustc-serialize = "^0.3.18"
time = "^0.1"
tokio-core = "^0.1"

[dev-dependencies]
trust-dns-server = { version = "*", path = "../server" }
2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trust-dns-server"
version = "0.8.1"
version = "0.9.0"
authors = ["Benjamin Fry <benjaminfry@me.com>"]

# A short blurb about the package. This is not rendered in any format when
Expand Down
2 changes: 1 addition & 1 deletion server/src/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ pub fn main() {
}

banner();
println!("awaiting connections...");
info!("awaiting connections...");
if let Err(e) = server.listen() {
error!("failed to listen: {}", e);
}
Expand Down
1 change: 1 addition & 0 deletions server/src/server/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ impl DnsHandler for (UdpSocket, VecDeque<UdpHandler>) {
}

impl DnsHandler for TcpHandler {
#[allow(deprecated)]
fn handle(&mut self, events: EventSet, catalog: &Arc<Catalog>) -> (Option<EventSet>, Option<(DnsHandlerType, EventSet)>) {
if events.is_error() {
warn!("closing, error from: {:?}", self.get_stream());
Expand Down
3 changes: 3 additions & 0 deletions server/src/server/server_future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ impl ServerFuture {

/// Register a UDP socket. Should be bound before calling this function.
pub fn register_socket(&self, socket: std::net::UdpSocket) {
debug!("registered udp: {:?}", socket);

// create the new UdpStream
let (buf_stream, stream_handle) = UdpStream::with_bound(socket, self.io_loop.handle());
let request_stream = RequestStream::new(buf_stream, stream_handle);
Expand Down Expand Up @@ -71,6 +73,7 @@ impl ServerFuture {
// TODO: this is an awkward interface with socketaddr...
let addr = listener.local_addr().expect("listener is not bound?");
let listener = tokio_core::net::TcpListener::from_listener(listener, &addr, &handle).expect("could not register listener");
debug!("registered tcp: {:?}", listener);

// for each incoming request...
self.io_loop.handle().spawn(
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions client/tests/client_tests.rs → server/tests/client_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl<'a> fmt::Debug for TestClientConnection<'a> {
}

#[test]
#[allow(deprecated)]
fn test_query_nonet() {
let authority = create_example();
let mut catalog = Catalog::new();
Expand All @@ -69,6 +70,7 @@ fn test_query_nonet() {

#[test]
#[ignore]
#[allow(deprecated)]
fn test_query_udp() {
let addr: SocketAddr = ("8.8.8.8",53).to_socket_addrs().unwrap().next().unwrap();
let conn = UdpClientConnection::new(addr).unwrap();
Expand All @@ -79,6 +81,7 @@ fn test_query_udp() {

#[test]
#[ignore]
#[allow(deprecated)]
fn test_query_tcp() {
let addr: SocketAddr = ("8.8.8.8",53).to_socket_addrs().unwrap().next().unwrap();
let conn = TcpClientConnection::new(addr).unwrap();
Expand Down Expand Up @@ -113,6 +116,7 @@ fn test_query<C: ClientConnection>(client: Client<C>) {
}

#[test]
#[allow(deprecated)]
fn test_secure_query_example_nonet() {
let authority = create_secure_example();

Expand All @@ -134,6 +138,7 @@ fn test_secure_query_example_nonet() {

#[test]
#[ignore]
#[allow(deprecated)]
fn test_secure_query_example_udp() {
let addr: SocketAddr = ("8.8.8.8",53).to_socket_addrs().unwrap().next().unwrap();
let conn = UdpClientConnection::new(addr).unwrap();
Expand All @@ -144,6 +149,7 @@ fn test_secure_query_example_udp() {

#[test]
#[ignore]
#[allow(deprecated)]
fn test_secure_query_example_tcp() {
let addr: SocketAddr = ("8.8.8.8",53).to_socket_addrs().unwrap().next().unwrap();
let conn = TcpClientConnection::new(addr).unwrap();
Expand Down Expand Up @@ -178,6 +184,7 @@ fn test_secure_query_example<C: ClientConnection>(client: Client<C>) {

#[test]
#[ignore]
#[allow(deprecated)]
fn test_dnssec_rollernet_td_udp() {
let c = Client::new(UdpClientConnection::new("8.8.8.8:53".parse().unwrap()).unwrap());
c.secure_query(
Expand All @@ -189,6 +196,7 @@ fn test_dnssec_rollernet_td_udp() {

#[test]
#[ignore]
#[allow(deprecated)]
fn test_dnssec_rollernet_td_tcp() {
let c = Client::new(TcpClientConnection::new("8.8.8.8:53".parse().unwrap()).unwrap());
c.secure_query(
Expand All @@ -200,6 +208,7 @@ fn test_dnssec_rollernet_td_tcp() {

#[test]
#[ignore]
#[allow(deprecated)]
fn test_dnssec_rollernet_td_tcp_mixed_case() {
let c = Client::new(TcpClientConnection::new("8.8.8.8:53".parse().unwrap()).unwrap());
c.secure_query(
Expand All @@ -210,6 +219,7 @@ fn test_dnssec_rollernet_td_tcp_mixed_case() {
}

#[test]
#[allow(deprecated)]
fn test_nsec_query_example_nonet() {
let authority = create_secure_example();

Expand All @@ -231,6 +241,7 @@ fn test_nsec_query_example_nonet() {

#[test]
#[ignore]
#[allow(deprecated)]
fn test_nsec_query_example_udp() {
let addr: SocketAddr = ("8.8.8.8",53).to_socket_addrs().unwrap().next().unwrap();
let conn = UdpClientConnection::new(addr).unwrap();
Expand All @@ -240,6 +251,7 @@ fn test_nsec_query_example_udp() {

#[test]
#[ignore]
#[allow(deprecated)]
fn test_nsec_query_example_tcp() {
let addr: SocketAddr = ("8.8.8.8",53).to_socket_addrs().unwrap().next().unwrap();
let conn = TcpClientConnection::new(addr).unwrap();
Expand All @@ -261,6 +273,7 @@ fn test_nsec_query_example<C: ClientConnection>(client: Client<C>) {

#[test]
#[ignore]
#[allow(deprecated)]
fn test_nsec_query_type() {
let name = domain::Name::with_labels(vec!["www".to_string(), "example".to_string(), "com".to_string()]);

Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions server/tests/server_future_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ fn test_server_www_tcp() {
// assert!(server_result.is_ok(), "server failed: {:?}", server_result);
}

#[allow(deprecated)] // TODO: for now...
fn client_thread_www<C: ClientConnection>(conn: C) {
let name = Name::with_labels(vec!["www".to_string(), "example".to_string(), "com".to_string()]);
println!("about to query server: {:?}", conn);
Expand Down
3 changes: 3 additions & 0 deletions server/tests/server_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ fn test_server_www_tcp() {
// assert!(server_result.is_ok(), "server failed: {:?}", server_result);
}

#[allow(deprecated)]
#[allow(dead_code)]
fn client_thread_www<C: ClientConnection>(conn: C) {
let name = Name::with_labels(vec!["www".to_string(), "example".to_string(), "com".to_string()]);
Expand Down Expand Up @@ -102,6 +103,7 @@ fn new_catalog() -> Catalog {
catalog
}

#[allow(deprecated)]
fn server_thread_udp(udp_socket: UdpSocket) {
let catalog = new_catalog();

Expand All @@ -111,6 +113,7 @@ fn server_thread_udp(udp_socket: UdpSocket) {
server.listen().unwrap();
}

#[allow(deprecated)]
fn server_thread_tcp(tcp_listener: TcpListener) {
let catalog = new_catalog();
let mut server = Server::new(catalog);
Expand Down
File renamed without changes.

0 comments on commit 65f7ae0

Please sign in to comment.