diff --git a/src/proto/connection.rs b/src/proto/connection.rs index f01d0ca..da58ba4 100644 --- a/src/proto/connection.rs +++ b/src/proto/connection.rs @@ -128,7 +128,7 @@ impl Connection P: Peer, B: IntoBuf { - /// Attempts to send a window update to the remote. + /// Attempts to send a window update to the remote, if one is pending. fn poll_send_window_update(&mut self) -> Poll<(), ConnectionError> { if let Some(f) = self.pending_send_window_update.take() { if self.inner.start_send(f.into())?.is_not_ready() { @@ -304,6 +304,7 @@ impl Sink for Connection -> StartSend { use frame::Frame::Headers; + trace!("Connection::start_send"); // First ensure that the upstream can process a new item. This ensures, for // instance, that any pending local window updates have been sent to the remote @@ -355,7 +356,7 @@ impl Sink for Connection Frame::Data { id, data, data_len, end_of_stream } => { self.claim_connection_send_window(data_len)?; - // The stream must be initialized at this point + // The stream must be initialized at this point. match self.streams.get_mut(&id) { None => return Err(error::User::InactiveStreamId.into()), Some(state) => try!(state.send_data(end_of_stream, data_len)), @@ -393,8 +394,9 @@ impl Sink for Connection } fn poll_complete(&mut self) -> Poll<(), ConnectionError> { - try_ready!(self.poll_send_window_update()); - self.inner.poll_complete() + trace!("Connection::poll_complete"); + try_ready!(self.inner.poll_complete()); + self.poll_send_window_update() } } @@ -404,7 +406,8 @@ impl ReadySink for Connection B: IntoBuf, { fn poll_ready(&mut self) -> Poll<(), Self::SinkError> { - try_ready!(self.poll_send_window_update()); - self.inner.poll_ready() + trace!("Connection::poll_ready"); + try_ready!(self.inner.poll_ready()); + self.poll_send_window_update() } }