mirror of
https://github.com/python/cpython.git
synced 2025-11-02 14:41:33 +00:00
GH-88968: Reject socket that is already used as a transport (#98010)
This commit is contained in:
parent
c11b667a1d
commit
c06276402b
2 changed files with 7 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ def __init__(self, selector=None):
|
|||
|
||||
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 @@ def _make_ssl_transport(
|
|||
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 @@ def _make_ssl_transport(
|
|||
|
||||
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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue