1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-03-14 19:06:25 +01:00

fix(server): fix panic in test server

This commit is contained in:
Rob Ede 2025-03-08 17:23:59 +00:00
parent 4b9f7ae46d
commit 323a2e2931
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
2 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@
## Unreleased ## Unreleased
- Fix panic in test server.
- Minimum supported Rust version (MSRV) is now 1.71. - Minimum supported Rust version (MSRV) is now 1.71.
## 2.5.0 ## 2.5.0

View File

@ -123,7 +123,9 @@ impl TestServerHandle {
/// Connect to server, returning a Tokio `TcpStream`. /// Connect to server, returning a Tokio `TcpStream`.
pub fn connect(&self) -> io::Result<TcpStream> { pub fn connect(&self) -> io::Result<TcpStream> {
TcpStream::from_std(net::TcpStream::connect(self.addr)?) let stream = net::TcpStream::connect(self.addr)?;
stream.set_nonblocking(true)?;
TcpStream::from_std(stream)
} }
} }