Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ws): allow setting max frame size. #439

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions actix-ws/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Allow changing the max frame size, using the newly-added `MessageStream::max_size` method.
- Remove type parameters from `Session::{text, binary}()` methods, replacing with equivalent `impl Trait` parameters.
- `Session::text()` now receives an `impl Into<ByteString>`, making broadcasting text messages more efficient.
- Allow sending continuations via `Session::continuation()`
Expand Down
6 changes: 6 additions & 0 deletions actix-ws/src/fut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ impl MessageStream {
pub async fn recv(&mut self) -> Option<Result<Message, ProtocolError>> {
poll_fn(|cx| Pin::new(&mut *self).poll_next(cx)).await
}

/// Set max frame size. See `actix-http::ws::Codec::max_size`.
pub fn max_size(mut self, size: usize) -> Self {
self.codec = self.codec.max_size(size);
self
}
}

impl Stream for StreamingBody {
Expand Down