Track http crate changes

This commit is contained in:
Carl Lerche
2017-08-03 10:00:50 -07:00
parent 9f9bf85168
commit e810b30999
6 changed files with 49 additions and 47 deletions

View File

@@ -174,7 +174,7 @@ impl<T, P, B> Connection<T, P, B>
// Update stream state while ensuring that the headers frame
// can be received.
if let Some(frame) = try!(self.streams.recv_headers(frame)) {
let frame = Self::convert_poll_message(frame);
let frame = Self::convert_poll_message(frame)?;
return Ok(Some(frame).into());
}
}
@@ -227,18 +227,18 @@ impl<T, P, B> Connection<T, P, B>
}
}
fn convert_poll_message(frame: frame::Headers) -> Frame<P::Poll> {
fn convert_poll_message(frame: frame::Headers) -> Result<Frame<P::Poll>, ConnectionError> {
if frame.is_trailers() {
Frame::Trailers {
Ok(Frame::Trailers {
id: frame.stream_id(),
headers: frame.into_fields()
}
})
} else {
Frame::Headers {
Ok(Frame::Headers {
id: frame.stream_id(),
end_of_stream: frame.is_end_stream(),
headers: P::convert_poll_message(frame),
}
headers: P::convert_poll_message(frame)?,
})
}
}
}