1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02:00

Fix server websockets big payloads support

This commit is contained in:
Nikolay Kim
2018-03-19 17:27:03 -07:00
parent 35ee5d36d8
commit 6cd40df387
8 changed files with 178 additions and 154 deletions

View File

@ -454,13 +454,13 @@ impl Stream for ClientReader {
// read
match Frame::parse(&mut inner.rx, false, max_size) {
Ok(Async::Ready(Some(frame))) => {
let (finished, opcode, payload) = frame.unpack();
let (_finished, opcode, payload) = frame.unpack();
match opcode {
// continuation is not supported
OpCode::Continue => {
inner.closed = true;
return Err(ProtocolError::NoContinuation)
Err(ProtocolError::NoContinuation)
},
OpCode::Bad => {
inner.closed = true;

View File

@ -329,7 +329,8 @@ impl<S> Stream for WsStream<S> where S: Stream<Item=Bytes, Error=PayloadError> {
match String::from_utf8(tmp) {
Ok(s) =>
Ok(Async::Ready(Some(Message::Text(s)))),
Err(_) => {
Err(e) => {
println!("ENC: {:?}", e);
self.closed = true;
Err(ProtocolError::BadEncoding)
}