mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
fix concurrent socket close (#6612)
This commit is contained in:
1 parent
b3b97cac7c
commit
d3afd465f3
1 file changed
+3
-3
@@ -2107,9 +2107,9 @@ mod _socket {
|
||||
|
||||
#[pymethod]
|
||||
fn close(&self) -> io::Result<()> {
|
||||
let sock = self.detach();
|
||||
if sock != INVALID_SOCKET as i64 {
|
||||
close_inner(sock as RawSocket)?;
|
||||
let sock = self.sock.write().take();
|
||||
if let Some(sock) = sock {
|
||||
close_inner(into_sock_fileno(sock))?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user