Skip to content

Commit

Permalink
Do not process data in read buffer after disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Nov 17, 2023
1 parent 2ecc983 commit eca6915
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ntex-mqtt"
version = "0.12.8"
version = "0.12.9"
authors = ["ntex contributors <[email protected]>"]
description = "Client and Server framework for MQTT v5 and v3.1.1 protocols"
documentation = "https://docs.rs/ntex-mqtt"
Expand All @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit eca6915

Please sign in to comment.