1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-24 01:11:07 +01:00

fix InFlightService::poll_ready() nested service rediness check

This commit is contained in:
Nikolay Kim 2019-03-12 15:48:02 -07:00
parent 6801a38de5
commit 5e6eed905c
3 changed files with 10 additions and 5 deletions

View File

@ -6,6 +6,11 @@
* `TimeoutService`, `InOrderService`, `InFlightService` accepts generic IntoService services.
### Fixed
* Fix `InFlightService::poll_ready()` nested service readiness check
## [0.3.3] - 2019-03-09
### Changed

View File

@ -221,7 +221,7 @@ where
fn poll_read(&mut self) -> bool {
loop {
match self.service.poll_ready() {
Ok(Async::Ready(_)) => loop {
Ok(Async::Ready(_)) => {
let item = match self.framed.poll() {
Ok(Async::Ready(Some(el))) => el,
Err(err) => {
@ -244,7 +244,7 @@ where
inner.task.notify();
Ok(())
}));
},
}
Ok(Async::NotReady) => return false,
Err(err) => {
self.state = TransportState::Error(FramedTransportError::Service(err));

View File

@ -67,9 +67,9 @@ where
type Future = InFlightServiceResponse<T>;
fn poll_ready(&mut self) -> Poll<(), Self::Error> {
self.service.poll_ready()?;
if !self.count.available() {
if let Async::NotReady = self.service.poll_ready()? {
Ok(Async::NotReady)
} else if !self.count.available() {
log::trace!("InFlight limit exceeded");
Ok(Async::NotReady)
} else {