diff --git a/src/lib.rs b/src/lib.rs
index 796c20c78..b31c5251d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,5 +1,4 @@
pub mod dynamic_resources;
mod macros;
pub mod piping_server;
-pub mod req_res_handler;
pub mod util;
diff --git a/src/main.rs b/src/main.rs
index e5f3bf82a..4f7e14038 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,7 +8,6 @@ use tokio::net::TcpListener;
use tokio_rustls::TlsAcceptor;
use piping_server::piping_server::PipingServer;
-use piping_server::req_res_handler::req_res_handler;
use piping_server::util;
/// Piping Server in Rust
@@ -86,10 +85,9 @@ async fn main() -> std::io::Result<()> {
});
let https_svc = make_service_fn(move |_| {
let piping_server = piping_server.clone();
- let handler = req_res_handler(move |req, res_sender| {
- piping_server.handler(true, req, res_sender)
- });
- futures::future::ok::<_, Infallible>(service_fn(handler))
+ futures::future::ok::<_, Infallible>(service_fn(move |req| {
+ piping_server.handler(true, req)
+ }))
});
let https_server = Server::builder(util::HyperAcceptor {
acceptor: incoming_tls_stream,
@@ -107,9 +105,9 @@ async fn main() -> std::io::Result<()> {
let http_svc = make_service_fn(|_| {
let piping_server = piping_server.clone();
- let handler =
- req_res_handler(move |req, res_sender| piping_server.handler(false, req, res_sender));
- futures::future::ok::<_, Infallible>(service_fn(handler))
+ futures::future::ok::<_, Infallible>(service_fn(move |req| {
+ piping_server.handler(false, req)
+ }))
});
let http_server = Server::bind(&(args.host, args.http_port).into()).serve(http_svc);
diff --git a/src/piping_server.rs b/src/piping_server.rs
index f5acffa48..31ac5b973 100644
--- a/src/piping_server.rs
+++ b/src/piping_server.rs
@@ -62,8 +62,9 @@ impl PipingServer {
&self,
uses_https: bool,
req: Request
,
- res_sender: oneshot::Sender>,
- ) -> impl std::future::Future