diff --git a/ntex/CHANGES.md b/ntex/CHANGES.md index 2231142a..51ca284f 100644 --- a/ntex/CHANGES.md +++ b/ntex/CHANGES.md @@ -1,8 +1,14 @@ # Changes -## [0.4.1] - 2021-09-23 +## [0.4.1] - 2021-09-27 -* framed::Read::resume() returns true if it was resumed +* server: Send `ServerStatus::WorkerFailed` update if worker is failed + +* server: Make `ServerBuilder::status_handler()` public + +* framed: Read::resume() returns true if it was paused before + +* http::client: Do not add content-length header for empty body #56 ## [0.4.0] - 2021-09-17 diff --git a/ntex/Cargo.toml b/ntex/Cargo.toml index c0aaaf82..bf766bd0 100644 --- a/ntex/Cargo.toml +++ b/ntex/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ntex" -version = "0.4.0" +version = "0.4.1" authors = ["ntex contributors "] description = "Framework for composable network services" readme = "README.md" diff --git a/ntex/src/http/client/sender.rs b/ntex/src/http/client/sender.rs index b17b5434..3b0cac70 100644 --- a/ntex/src/http/client/sender.rs +++ b/ntex/src/http/client/sender.rs @@ -232,7 +232,7 @@ impl RequestHeadType { timeout: Millis, config: &ClientConfig, ) -> SendClientRequest { - self.send_body(addr, response_decompress, timeout, config, Body::Empty) + self.send_body(addr, response_decompress, timeout, config, Body::None) } fn set_header_if_none( diff --git a/ntex/src/server/accept.rs b/ntex/src/server/accept.rs index 37c43cf5..72bd05e2 100644 --- a/ntex/src/server/accept.rs +++ b/ntex/src/server/accept.rs @@ -386,6 +386,7 @@ impl Accept { match self.workers[self.next].send(msg) { Ok(_) => (), Err(tmp) => { + self.update_status(ServerStatus::WorkerFailed); self.srv.worker_faulted(self.workers[self.next].idx); msg = tmp; self.workers.swap_remove(self.next); @@ -413,6 +414,7 @@ impl Accept { } Err(tmp) => { trace!("Worker failed while processing connection"); + self.update_status(ServerStatus::WorkerFailed); self.srv.worker_faulted(self.workers[self.next].idx); msg = tmp; self.workers.swap_remove(self.next); diff --git a/ntex/src/server/builder.rs b/ntex/src/server/builder.rs index 382b217f..34e446df 100644 --- a/ntex/src/server/builder.rs +++ b/ntex/src/server/builder.rs @@ -128,7 +128,6 @@ impl ServerBuilder { self } - #[doc(hidden)] /// Set server status handler. /// /// Server calls this handler on every inner status update. diff --git a/ntex/src/server/mod.rs b/ntex/src/server/mod.rs index 70bb1db2..85b21695 100644 --- a/ntex/src/server/mod.rs +++ b/ntex/src/server/mod.rs @@ -33,10 +33,13 @@ pub use self::test::{build_test_server, test_server, TestServer}; #[doc(hidden)] pub use self::socket::FromStream; +#[non_exhaustive] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] /// Server readiness status pub enum ServerStatus { Ready, NotReady, + WorkerFailed, } /// Socket id token diff --git a/ntex/src/time/mod.rs b/ntex/src/time/mod.rs index dabe6df6..7753a1d1 100644 --- a/ntex/src/time/mod.rs +++ b/ntex/src/time/mod.rs @@ -247,6 +247,7 @@ mod tests { assert!(second_time - first_time >= time::Duration::from_millis(wait_time)); } + #[cfg(not(target_os = "macos"))] #[crate::rt_test] async fn test_interval() { let mut int = interval(Millis(250)); @@ -272,6 +273,7 @@ mod tests { ); } + #[cfg(not(target_os = "macos"))] #[crate::rt_test] async fn test_interval_one_sec() { let int = interval(Millis::ONE_SEC);