diff --git a/actix-ws/CHANGELOG.md b/actix-ws/CHANGELOG.md index 5a50f8ead..086c19e6e 100644 --- a/actix-ws/CHANGELOG.md +++ b/actix-ws/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Ensure TCP connection is properly shut down when session is dropped. + ## 0.3.0 - Add `AggregatedMessage[Stream]` types. diff --git a/actix-ws/src/stream.rs b/actix-ws/src/stream.rs index e95c17f43..fcca98168 100644 --- a/actix-ws/src/stream.rs +++ b/actix-ws/src/stream.rs @@ -145,6 +145,10 @@ impl Stream for StreamingBody { return Poll::Ready(Some(Ok(mem::take(&mut this.buf).freeze()))); } + if this.closing { + return Poll::Ready(None); + } + Poll::Pending } }