From 462253266db64dc231c54b414ce0c1eab8da4c1a Mon Sep 17 00:00:00 2001 From: Benjamin Leggett Date: Thu, 25 Apr 2024 22:23:10 -0400 Subject: [PATCH] this changed Signed-off-by: Benjamin Leggett --- src/proxy/pool.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/proxy/pool.rs b/src/proxy/pool.rs index 8258dd50..58407b51 100644 --- a/src/proxy/pool.rs +++ b/src/proxy/pool.rs @@ -646,6 +646,7 @@ mod test { use hyper::{Request, Response}; use std::sync::atomic::AtomicU32; use std::time::Duration; + use tokio::io::AsyncWriteExt; use tokio::net::TcpListener; use tokio::task::{self}; use tokio::time::sleep; @@ -1397,9 +1398,9 @@ mod test { tokio::task::spawn(async move { match hyper::upgrade::on(req).await { Ok(upgraded) => { - let (mut ri, mut wi) = - tokio::io::split(hyper_util::rt::TokioIo::new(upgraded)); - tcp::handle_stream(tcp::Mode::ReadWrite, &mut ri, &mut wi).await; + let mut io = hyper_util::rt::TokioIo::new(upgraded); + io.write_all(b"poolsrv\n").await.unwrap(); + tcp::handle_stream(tcp::Mode::ReadWrite, &mut io).await; } Err(e) => panic!("No upgrade {e}"), }