Skip to content

Commit

Permalink
actix-web-actors: take the internal buffer when yielding (#3369)
Browse files Browse the repository at this point in the history
* actix-web-actors: take the internal buffer when yielding

* actix-web-actors: Add CHANGES entry re: taking buffer
  • Loading branch information
asonix committed Jun 9, 2024
1 parent 8018983 commit f7646bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions actix-web-actors/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Take the encoded buffer when yielding bytes in the response stream rather than splitting the buffer, reducing memory use
- Minimum supported Rust version (MSRV) is now 1.72.

## 4.3.0
Expand Down
2 changes: 1 addition & 1 deletion actix-web-actors/src/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ where
}

if !this.buf.is_empty() {
Poll::Ready(Some(Ok(this.buf.split().freeze())))
Poll::Ready(Some(Ok(std::mem::take(&mut this.buf).freeze())))
} else if this.fut.alive() && !this.closed {
Poll::Pending
} else {
Expand Down

0 comments on commit f7646bc

Please sign in to comment.