1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02:00
This commit is contained in:
Nikolay Kim
2018-03-09 05:36:40 -08:00
parent 49e007ff2a
commit 1c6ddfd34c
3 changed files with 11 additions and 9 deletions

View File

@ -198,6 +198,7 @@ impl Frame {
-> Poll<Option<Frame>, ProtocolError>
where S: Stream<Item=Bytes, Error=PayloadError>
{
// try to parse ws frame md from one chunk
let result = match pl.get_chunk()? {
Async::NotReady => return Ok(Async::NotReady),
Async::Ready(Some(chunk)) => Frame::read_chunk_md(chunk, server, max_size)?,
@ -205,6 +206,7 @@ impl Frame {
};
let (idx, finished, opcode, length, mask) = match result {
// we may need to join several chunks
Async::NotReady => match Frame::read_copy_md(pl, server, max_size)? {
Async::NotReady => return Ok(Async::NotReady),
Async::Ready(Some(item)) => item,
@ -228,7 +230,7 @@ impl Frame {
finished, opcode, payload: Binary::from("") })));
}
let data = match pl.readexactly(length)? {
let data = match pl.read_exact(length)? {
Async::Ready(Some(buf)) => buf,
Async::Ready(None) => return Ok(Async::Ready(None)),
Async::NotReady => panic!(),