mirror of https://github.com/MagicStack/uvloop.git
loop: Make create_unix_connection accept only UNIX sockets
This commit is contained in:
parent
81d782bc33
commit
c9d4bf9cdf
|
@ -262,7 +262,7 @@ class _TestUnix:
|
|||
run(client)
|
||||
|
||||
def test_create_unix_connection_4(self):
|
||||
sock = socket.socket()
|
||||
sock = socket.socket(socket.AF_UNIX)
|
||||
sock.close()
|
||||
|
||||
async def client():
|
||||
|
|
|
@ -1251,6 +1251,10 @@ cdef class Loop:
|
|||
if sock is None:
|
||||
raise ValueError('no path and sock were specified')
|
||||
|
||||
if sock.family != uv.AF_UNIX:
|
||||
raise ValueError(
|
||||
'A UNIX Domain Socket was expected, got {!r}'.format(sock))
|
||||
|
||||
fut = aio_Future(loop=self)
|
||||
protocol = protocol_factory()
|
||||
tr = UVPipeTransport.new(self, protocol, None)
|
||||
|
|
Loading…
Reference in New Issue