diff --git a/CHANGES.md b/CHANGES.md index 9884f2b..ff694a9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [0.12.9] - 2023-11-17 + +* Do not process data in read buffer after disconnect + ## [0.12.8] - 2023-11-12 * Use new ntex-io apis diff --git a/Cargo.toml b/Cargo.toml index 0ad880e..8e321b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ntex-mqtt" -version = "0.12.8" +version = "0.12.9" authors = ["ntex contributors "] description = "Client and Server framework for MQTT v5 and v3.1.1 protocols" documentation = "https://docs.rs/ntex-mqtt" @@ -26,7 +26,7 @@ thiserror = "1.0" [dev-dependencies] env_logger = "0.10" -ntex-tls = "0.3.1" +ntex-tls = "0.3" rustls = "0.21" rustls-pemfile = "1.0" openssl = "0.10" diff --git a/src/io.rs b/src/io.rs index 2c59e8f..98c0252 100644 --- a/src/io.rs +++ b/src/io.rs @@ -253,6 +253,12 @@ where IoDispatcherState::Processing => { let item = match ready!(inner.poll_service(this.service, cx)) { PollService::Ready => { + if inner.io.is_closed() { + log::trace!("io has been closed, stop dispatcher"); + inner.st = IoDispatcherState::Stop; + continue; + } + // decode incoming bytes stream match inner.io.poll_recv_decode(this.codec, cx) { Ok(decoded) => {