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)
|
run(client)
|
||||||
|
|
||||||
def test_create_unix_connection_4(self):
|
def test_create_unix_connection_4(self):
|
||||||
sock = socket.socket()
|
sock = socket.socket(socket.AF_UNIX)
|
||||||
sock.close()
|
sock.close()
|
||||||
|
|
||||||
async def client():
|
async def client():
|
||||||
|
|
|
@ -1251,6 +1251,10 @@ cdef class Loop:
|
||||||
if sock is None:
|
if sock is None:
|
||||||
raise ValueError('no path and sock were specified')
|
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)
|
fut = aio_Future(loop=self)
|
||||||
protocol = protocol_factory()
|
protocol = protocol_factory()
|
||||||
tr = UVPipeTransport.new(self, protocol, None)
|
tr = UVPipeTransport.new(self, protocol, None)
|
||||||
|
|
Loading…
Reference in New Issue