diff --git a/tonic/src/transport/server/mod.rs b/tonic/src/transport/server/mod.rs index c8bb74edd..9819661dd 100644 --- a/tonic/src/transport/server/mod.rs +++ b/tonic/src/transport/server/mod.rs @@ -43,7 +43,7 @@ use crate::body::BoxBody; use bytes::Bytes; use http::{Request, Response}; use http_body::Body as _; -use hyper::{server::accept, Body}; +use hyper::Body; use pin_project::pin_project; use std::{ convert::Infallible, @@ -57,6 +57,7 @@ use std::{ time::Duration, }; use tokio::io::{AsyncRead, AsyncWrite}; +use tokio::net::TcpStream; use tokio_stream::Stream; use tower::{ layer::util::{Identity, Stack}, @@ -527,7 +528,7 @@ impl Server { let svc = self.service_builder.service(svc); let tcp = incoming::tcp_incoming(incoming, self); - let incoming = accept::from_stream::<_, _, crate::Error>(tcp); + let incoming = TcpStream::accept::from_stream::<_, _, crate::Error>(tcp); let svc = MakeSvc { inner: svc,