1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-24 03:42:59 +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. * `TimeoutService`, `InOrderService`, `InFlightService` accepts generic IntoService services.
### Fixed
* Fix `InFlightService::poll_ready()` nested service readiness check
## [0.3.3] - 2019-03-09 ## [0.3.3] - 2019-03-09
### Changed ### Changed

View File

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

View File

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