diff --git a/src/body/body.rs b/src/body/body.rs index 097615ca..33f4189c 100644 --- a/src/body/body.rs +++ b/src/body/body.rs @@ -272,7 +272,7 @@ impl Body { }, Kind::H2 { recv: ref mut h2, .. - } => match ready!(Pin::new(&mut *h2).poll_next(cx)) { + } => match ready!(h2.poll_data(cx)) { Some(Ok(bytes)) => { let _ = h2.release_capacity().release_capacity(bytes.len()); Poll::Ready(Some(Ok(Chunk::from(bytes)))) diff --git a/src/proto/h2/server.rs b/src/proto/h2/server.rs index 23600cc3..72047849 100644 --- a/src/proto/h2/server.rs +++ b/src/proto/h2/server.rs @@ -169,7 +169,7 @@ where } // When the service is ready, accepts an incoming request. - match ready!(Pin::new(&mut self.conn).poll_next(cx)) { + match ready!(self.conn.poll_accept(cx)) { Some(Ok((req, respond))) => { trace!("incoming request"); let content_length = content_length_parse_all(req.headers());