mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-28 01:32:57 +01:00
call poll_io recursevely aftre drain completion
This commit is contained in:
parent
3d3e4dae9a
commit
1baead993a
@ -5,8 +5,7 @@ use bytes::Bytes;
|
||||
use futures::{Future, Poll, Async};
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
|
||||
use h1;
|
||||
use h2;
|
||||
use {h1, h2};
|
||||
use error::Error;
|
||||
use h1writer::Writer;
|
||||
use httprequest::HttpRequest;
|
||||
|
@ -711,8 +711,16 @@ impl<S, H> ProcessResponse<S, H> {
|
||||
// flush io but only if we need to
|
||||
if self.running == RunningState::Paused || self.drain.is_some() {
|
||||
match io.poll_completed() {
|
||||
Ok(Async::Ready(_)) =>
|
||||
self.running.resume(),
|
||||
Ok(Async::Ready(_)) => {
|
||||
self.running.resume();
|
||||
|
||||
// resolve drain futures
|
||||
if let Some(tx) = self.drain.take() {
|
||||
let _ = tx.send(());
|
||||
}
|
||||
// restart io processing
|
||||
return self.poll_io(io, info);
|
||||
},
|
||||
Ok(Async::NotReady) =>
|
||||
return Err(PipelineState::Response(self)),
|
||||
Err(err) => {
|
||||
@ -723,11 +731,6 @@ impl<S, H> ProcessResponse<S, H> {
|
||||
}
|
||||
}
|
||||
|
||||
// drain futures
|
||||
if let Some(tx) = self.drain.take() {
|
||||
let _ = tx.send(());
|
||||
}
|
||||
|
||||
// response is completed
|
||||
match self.iostate {
|
||||
IOState::Done => {
|
||||
|
Loading…
Reference in New Issue
Block a user