From 8b35cfc701bdfd276da01e7f7c7a689fff3bb83a Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Tue, 7 Mar 2023 17:06:33 +0100 Subject: [PATCH] loop --- hyper/src/server/accept.rs | 11 ----------- hyper/src/server/server.rs | 11 ++++++----- hyper/src/server/tcp.rs | 6 ------ hyper/src/service/make.rs | 2 +- 4 files changed, 7 insertions(+), 23 deletions(-) diff --git a/hyper/src/server/accept.rs b/hyper/src/server/accept.rs index 9082a55..56c54ff 100644 --- a/hyper/src/server/accept.rs +++ b/hyper/src/server/accept.rs @@ -18,11 +18,6 @@ pub trait Accept { type Conn; type Error; - - fn poll_accept( - self: Pin<&mut Self>, - cx: &mut task::Context<'_>, - ) -> Poll>>; } #[cfg(feature = "stream")] @@ -39,12 +34,6 @@ where { type Conn = IO; type Error = E; - fn poll_accept( - self: Pin<&mut Self>, - cx: &mut task::Context<'_>, - ) -> Poll>> { - loop {} - } } FromStream { stream } } diff --git a/hyper/src/server/server.rs b/hyper/src/server/server.rs index 5bf86b1..9eb7119 100644 --- a/hyper/src/server/server.rs +++ b/hyper/src/server/server.rs @@ -3,14 +3,15 @@ use super::accept::Accept; use super::conn::Http as Http_; #[cfg(all(feature = "tcp"))] use super::tcp::AddrIncoming; -use crate::body::{Body}; +use crate::body::{Body, HttpBody}; use crate::common::exec::Exec; -use crate::common::exec::{NewSvcExec}; -use crate::common::{task, Future, Pin, Poll}; +use crate::common::exec::{ConnStreamExec, NewSvcExec}; +use crate::common::{task, Future, Pin, Poll, Unpin}; use crate::service::{HttpService, MakeServiceRef}; use pin_project_lite::pin_project; use std::error::Error as StdError; - +#[cfg(feature = "tcp")] +use tokio::io::{AsyncRead, AsyncWrite}; pub struct Server { incoming: I, make_service: S, @@ -90,7 +91,7 @@ where } pub(crate) mod new_svc { use super::Watcher; - use crate::body::{Body}; + use crate::body::{Body, HttpBody}; use crate::common::exec::ConnStreamExec; use crate::common::{task, Future, Pin, Poll}; use crate::service::HttpService; diff --git a/hyper/src/server/tcp.rs b/hyper/src/server/tcp.rs index 29a2c86..89a3a0a 100644 --- a/hyper/src/server/tcp.rs +++ b/hyper/src/server/tcp.rs @@ -63,12 +63,6 @@ impl AddrIncoming { impl Accept for AddrIncoming { type Conn = AddrStream; type Error = io::Error; - fn poll_accept( - mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, - ) -> Poll>> { - loop {} - } } impl fmt::Debug for AddrIncoming { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/hyper/src/service/make.rs b/hyper/src/service/make.rs index 3f4f369..cf542f1 100644 --- a/hyper/src/service/make.rs +++ b/hyper/src/service/make.rs @@ -30,7 +30,7 @@ where pub trait MakeServiceRef { type ResBody; type Error; - type Service: HttpService; + type Service: HttpService; } impl MakeServiceRef for T