diff --git a/.travis.yml b/.travis.yml index 95978f09..ef8f0fd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ cache: script: - cargo build --verbose $FEATURES - cargo test --verbose $FEATURES - - '[ $TRAVIS_RUST_VERSION = nightly ] && cargo bench --no-run || :' + - 'if [ $TRAVIS_RUST_VERSION = nightly ]; then cargo bench --no-run; fi' addons: apt: diff --git a/benches/client.rs b/benches/client.rs old mode 100644 new mode 100755 index d639c75c..431fdbc5 --- a/benches/client.rs +++ b/benches/client.rs @@ -7,6 +7,8 @@ extern crate test; use std::fmt; use std::io::{self, Read, Write, Cursor}; use std::net::SocketAddr; +#[cfg(feature = "timeouts")] +use std::time::Duration; use hyper::net; @@ -73,6 +75,16 @@ impl net::NetworkStream for MockStream { fn peer_addr(&mut self) -> io::Result { Ok("127.0.0.1:1337".parse().unwrap()) } + #[cfg(feature = "timeouts")] + fn set_read_timeout(&self, _: Option) -> io::Result<()> { + // can't time out + Ok(()) + } + #[cfg(feature = "timeouts")] + fn set_write_timeout(&self, _: Option) -> io::Result<()> { + // can't time out + Ok(()) + } } struct MockConnector; diff --git a/src/server/listener.rs b/src/server/listener.rs index 5fadc0fb..a6b86d79 100644 --- a/src/server/listener.rs +++ b/src/server/listener.rs @@ -27,7 +27,7 @@ impl ListenerPool { let work = Arc::new(work); // Begin work. - for _ in (0..threads) { + for _ in 0..threads { spawn_with(super_tx.clone(), work.clone(), self.acceptor.clone()) }