socket: limit getaddrinfo to TCP connections
This commit is contained in:
parent
49c207a4c9
commit
2992c13ca7
@ -81,7 +81,7 @@ class _Socket(AbstractServer):
|
|||||||
class _SocketServer(_Socket):
|
class _SocketServer(_Socket):
|
||||||
|
|
||||||
def __init__(self, host, port, bind=None, **kwargs):
|
def __init__(self, host, port, bind=None, **kwargs):
|
||||||
(family, type, proto, canonname, sockaddr) = socket.getaddrinfo(host, port)[0]
|
(family, type, proto, canonname, sockaddr) = socket.getaddrinfo(host, port, proto=socket.IPPROTO_TCP)[0]
|
||||||
|
|
||||||
if isinstance(self, ssl.SSLSocket) and "server_hostname" not in kwargs:
|
if isinstance(self, ssl.SSLSocket) and "server_hostname" not in kwargs:
|
||||||
kwargs["server_hostname"] = host
|
kwargs["server_hostname"] = host
|
||||||
|
Loading…
x
Reference in New Issue
Block a user