From 0564747121b772e6a4f858580590650840459ba1 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 29 Jun 2017 20:41:46 -0700 Subject: [PATCH] Tweaks --- src/proto/connection.rs | 14 ++++++++++---- src/proto/settings.rs | 3 +-- 2 files changed, 11 insertions(+), 6 deletions(-) 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)),