1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-07-01 04:05:09 +02:00

fix handle big data chunkd for parsing

This commit is contained in:
Nikolay Kim
2018-02-27 23:04:57 -08:00
parent 4a48b43927
commit 7591592279
3 changed files with 16 additions and 13 deletions

View File

@ -10,7 +10,7 @@ use actix::Arbiter;
use httparse;
use http::{Uri, Method, Version, HttpTryFrom, HeaderMap};
use http::header::{self, HeaderName, HeaderValue};
use bytes::{Bytes, BytesMut};
use bytes::{Bytes, BytesMut, BufMut};
use futures::{Future, Poll, Async};
use tokio_core::reactor::Timeout;
@ -474,7 +474,7 @@ impl Reader {
error!("MAX_BUFFER_SIZE unprocessed data reached, closing");
return Err(ReaderError::Error(ParseError::TooLarge));
}
if read {
if read || buf.remaining_mut() == 0 {
match utils::read_from_io(io, buf) {
Ok(Async::Ready(0)) => {
debug!("Ignored premature client disconnection");