logging
This commit is contained in:
@@ -128,7 +128,7 @@ impl<T, P, B> Connection<T, P, B>
|
|||||||
P: Peer,
|
P: Peer,
|
||||||
B: IntoBuf
|
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> {
|
fn poll_send_window_update(&mut self) -> Poll<(), ConnectionError> {
|
||||||
if let Some(f) = self.pending_send_window_update.take() {
|
if let Some(f) = self.pending_send_window_update.take() {
|
||||||
if self.inner.start_send(f.into())?.is_not_ready() {
|
if self.inner.start_send(f.into())?.is_not_ready() {
|
||||||
@@ -304,6 +304,7 @@ impl<T, P, B> Sink for Connection<T, P, B>
|
|||||||
-> StartSend<Self::SinkItem, Self::SinkError>
|
-> StartSend<Self::SinkItem, Self::SinkError>
|
||||||
{
|
{
|
||||||
use frame::Frame::Headers;
|
use frame::Frame::Headers;
|
||||||
|
trace!("Connection::start_send");
|
||||||
|
|
||||||
// First ensure that the upstream can process a new item. This ensures, for
|
// 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
|
// instance, that any pending local window updates have been sent to the remote
|
||||||
@@ -355,7 +356,7 @@ impl<T, P, B> Sink for Connection<T, P, B>
|
|||||||
Frame::Data { id, data, data_len, end_of_stream } => {
|
Frame::Data { id, data, data_len, end_of_stream } => {
|
||||||
self.claim_connection_send_window(data_len)?;
|
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) {
|
match self.streams.get_mut(&id) {
|
||||||
None => return Err(error::User::InactiveStreamId.into()),
|
None => return Err(error::User::InactiveStreamId.into()),
|
||||||
Some(state) => try!(state.send_data(end_of_stream, data_len)),
|
Some(state) => try!(state.send_data(end_of_stream, data_len)),
|
||||||
@@ -393,8 +394,9 @@ impl<T, P, B> Sink for Connection<T, P, B>
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn poll_complete(&mut self) -> Poll<(), ConnectionError> {
|
fn poll_complete(&mut self) -> Poll<(), ConnectionError> {
|
||||||
try_ready!(self.poll_send_window_update());
|
trace!("Connection::poll_complete");
|
||||||
self.inner.poll_complete()
|
try_ready!(self.inner.poll_complete());
|
||||||
|
self.poll_send_window_update()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,7 +406,8 @@ impl<T, P, B> ReadySink for Connection<T, P, B>
|
|||||||
B: IntoBuf,
|
B: IntoBuf,
|
||||||
{
|
{
|
||||||
fn poll_ready(&mut self) -> Poll<(), Self::SinkError> {
|
fn poll_ready(&mut self) -> Poll<(), Self::SinkError> {
|
||||||
try_ready!(self.poll_send_window_update());
|
trace!("Connection::poll_ready");
|
||||||
self.inner.poll_ready()
|
try_ready!(self.inner.poll_ready());
|
||||||
|
self.poll_send_window_update()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user