diff --git a/src/proto/connection.rs b/src/proto/connection.rs index a7d216a..be453f3 100644 --- a/src/proto/connection.rs +++ b/src/proto/connection.rs @@ -62,11 +62,17 @@ impl Stream for Connection fn poll(&mut self) -> Poll, ConnectionError> { use frame::Frame::*; - // Because receiving new frames may depend on ensuring that the write - // buffer is clear, `poll_complete` is called here. - let _ = try!(self.poll_complete()); + let frame = match try!(self.inner.poll()) { + Async::Ready(f) => f, + Async::NotReady => { + // Because receiving new frames may depend on ensuring that the + // write buffer is clear, `poll_complete` is called here. + let _ = try!(self.poll_complete()); + return Ok(Async::NotReady); + } + }; - let frame = match try_ready!(self.inner.poll()) { + let frame = match frame { Some(Headers(v)) => { // TODO: Update stream state let stream_id = v.stream_id(); diff --git a/src/proto/settings.rs b/src/proto/settings.rs index 7cedf5d..e2385c3 100644 --- a/src/proto/settings.rs +++ b/src/proto/settings.rs @@ -92,8 +92,7 @@ impl Stream for Settings // Save off the settings self.remote = v.into_set(); - // TODO: uncomment? - // let _ = try!(self.try_send_pending()); + let _ = try!(self.try_send_pending()); } } v => return Ok(Async::Ready(v)),