try to fix test

This commit is contained in:
fakeshadow 2021-11-01 17:31:05 +08:00
parent 17d7c76843
commit 7f5212c990
1 changed files with 6 additions and 8 deletions

View File

@ -795,8 +795,7 @@ async fn client_unread_response() {
let lst = std::net::TcpListener::bind(addr).unwrap(); let lst = std::net::TcpListener::bind(addr).unwrap();
std::thread::spawn(move || { std::thread::spawn(move || {
for stream in lst.incoming() { let (mut stream, _) = lst.accept().unwrap();
let mut stream = stream.unwrap();
let mut b = [0; 1000]; let mut b = [0; 1000];
let _ = stream.read(&mut b).unwrap(); let _ = stream.read(&mut b).unwrap();
let _ = stream.write_all( let _ = stream.write_all(
@ -805,7 +804,6 @@ async fn client_unread_response() {
\r\n\ \r\n\
welcome!", welcome!",
); );
}
}); });
// client request // client request