Skip to content

Commit ac8fd6f

Browse files
committed
fix: avoid try_clone in net_connect to prevent Windows socket state corruption
Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 52a28ce commit ac8fd6f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

host/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,10 +1237,8 @@ fn handle_net_connect(
12371237
let addr = parse_sockaddr(args)?;
12381238
policy.check(&addr)?;
12391239
let sa: SockAddr = addr.into();
1240-
let sock = {
1241-
let tbl = table.lock().unwrap();
1242-
tbl.get_socket(fd)?.try_clone()?
1243-
};
1240+
let tbl = table.lock().unwrap();
1241+
let sock = tbl.get_socket(fd)?;
12441242
sock.connect_timeout(&sa, SOCKET_TIMEOUT)?;
12451243
Ok(json!({}))
12461244
}

0 commit comments

Comments
 (0)