diff options
author | Guido van Rossum <guido@python.org> | 2022-10-07 19:56:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-07 19:56:50 (GMT) |
commit | c06276402b5f23d49a39dfcaf45ed81b5c88efe7 (patch) | |
tree | 3a076a7c64241cb9e6e774c82592239c54f7b800 /Lib/asyncio/selector_events.py | |
parent | c11b667a1d8c13095b295d1a8c4ab6e4ccf0f895 (diff) | |
download | cpython-c06276402b5f23d49a39dfcaf45ed81b5c88efe7.zip cpython-c06276402b5f23d49a39dfcaf45ed81b5c88efe7.tar.gz cpython-c06276402b5f23d49a39dfcaf45ed81b5c88efe7.tar.bz2 |
GH-88968: Reject socket that is already used as a transport (#98010)
Diffstat (limited to 'Lib/asyncio/selector_events.py')
-rw-r--r-- | Lib/asyncio/selector_events.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index c9bbe2a..d2ee49d 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -58,6 +58,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop): def _make_socket_transport(self, sock, protocol, waiter=None, *, extra=None, server=None): + self._ensure_fd_no_transport(sock) return _SelectorSocketTransport(self, sock, protocol, waiter, extra, server) @@ -68,6 +69,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop): ssl_handshake_timeout=constants.SSL_HANDSHAKE_TIMEOUT, ssl_shutdown_timeout=constants.SSL_SHUTDOWN_TIMEOUT, ): + self._ensure_fd_no_transport(rawsock) ssl_protocol = sslproto.SSLProtocol( self, protocol, sslcontext, waiter, server_side, server_hostname, @@ -80,6 +82,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop): def _make_datagram_transport(self, sock, protocol, address=None, waiter=None, extra=None): + self._ensure_fd_no_transport(sock) return _SelectorDatagramTransport(self, sock, protocol, address, waiter, extra) |