Don't panic on poll_trailers called out of order. (#189)

This patch removes a panic in `poll_trailers` that is triggered if
`poll_trailers` is called before `poll_data` returns `None`.

This is done by always trying to notify the receive task when
`poll_data` returns None and there already is pending trailers.
This commit is contained in:
Carl Lerche
2017-12-19 20:05:12 -08:00
committed by GitHub
parent 1552d62e7c
commit 4cc573fa89
2 changed files with 15 additions and 7 deletions

View File

@@ -149,8 +149,6 @@ impl RecvStream {
}
/// Returns received trailers.
///
/// This function **must** not be called until `Body::poll` returns `None`.
pub fn poll_trailers(&mut self) -> Poll<Option<HeaderMap>, ::Error> {
self.inner.inner.poll_trailers().map_err(Into::into)
}