1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-20 04:35:38 +02:00

optimize websocket stream

This commit is contained in:
Nikolay Kim
2018-03-08 17:19:50 -08:00
parent 395243a539
commit ebdc983dfe
7 changed files with 123 additions and 37 deletions

View File

@@ -482,10 +482,10 @@ impl<S> InnerField<S> where S: Stream<Item=Bytes, Error=PayloadError> {
if &chunk[..2] == b"\r\n" && &chunk[2..4] == b"--" &&
&chunk[4..] == boundary.as_bytes()
{
payload.unread_data(chunk.freeze());
payload.unread_data(chunk);
Ok(Async::Ready(None))
} else {
Ok(Async::Ready(Some(chunk.freeze())))
Ok(Async::Ready(Some(chunk)))
}
}
}