diff --git a/tonic/src/transport/server/incoming.rs b/tonic/src/transport/server/incoming.rs index 59ecec2b1..e55c6a171 100644 --- a/tonic/src/transport/server/incoming.rs +++ b/tonic/src/transport/server/incoming.rs @@ -74,12 +74,12 @@ where yield io; } - SelectOutput::TcpAcceptErr(e) => match handle_tcp_accept_error(e) { + SelectOutput::TcpErr(e) => match handle_tcp_accept_error(e) { ControlFlow::Continue(()) => continue, ControlFlow::Break(e) => Err(e)?, } - SelectOutput::TlsAcceptErr(e) => { + SelectOutput::TlsErr(e) => { tracing::debug!(error = %e, "tls accept error"); continue; } @@ -102,8 +102,6 @@ fn handle_tcp_accept_error(e: impl Into) -> ControlFlow SelectOutput::Incoming(stream), Ok(None) => SelectOutput::Done, - Err(e) => SelectOutput::TcpAcceptErr(e.into()), + Err(e) => SelectOutput::TcpErr(e.into()), }; } @@ -135,15 +133,15 @@ where match stream { Ok(Some(stream)) => SelectOutput::Incoming(stream), Ok(None) => SelectOutput::Done, - Err(e) => SelectOutput::TcpAcceptErr(e.into()), + Err(e) => SelectOutput::TcpErr(e.into()), } } accept = tasks.join_next() => { match accept.expect("JoinSet should never end") { Ok(Ok(io)) => SelectOutput::Io(io), - Ok(Err(e)) => SelectOutput::TlsAcceptErr(e), - Err(e) => SelectOutput::TlsAcceptErr(e.into()), + Ok(Err(e)) => SelectOutput::TlsErr(e), + Err(e) => SelectOutput::TlsErr(e.into()), } } } @@ -153,8 +151,8 @@ where enum SelectOutput { Incoming(A), Io(ServerIo), - TcpAcceptErr(crate::Error), - TlsAcceptErr(crate::Error), + TcpErr(crate::Error), + TlsErr(crate::Error), Done, }