mirror of
https://github.com/python/cpython.git
synced 2025-07-07 11:25:30 +00:00
gh-127840: Revert "gh-127840: pass flags and address from send_fds (GH-127841)" (#134482)
Revert "gh-127840: pass flags and address from send_fds (GH-127841)"
This reverts commit 518c95b552
.
This commit is contained in:
parent
f3fc0c16e0
commit
296a66051e
3 changed files with 1 additions and 26 deletions
|
@ -563,7 +563,7 @@ if hasattr(_socket.socket, "sendmsg"):
|
|||
import array
|
||||
|
||||
return sock.sendmsg(buffers, [(_socket.SOL_SOCKET,
|
||||
_socket.SCM_RIGHTS, array.array("i", fds))], flags, address)
|
||||
_socket.SCM_RIGHTS, array.array("i", fds))])
|
||||
__all__.append("send_fds")
|
||||
|
||||
if hasattr(_socket.socket, "recvmsg"):
|
||||
|
|
|
@ -7366,30 +7366,6 @@ class SendRecvFdsTests(unittest.TestCase):
|
|||
data = os.read(rfd, 100)
|
||||
self.assertEqual(data, str(index).encode())
|
||||
|
||||
def testSendAndRecvFdsByAddress(self):
|
||||
rfd, wfd = os.pipe()
|
||||
self.addCleanup(os.close, rfd)
|
||||
self.addCleanup(os.close, wfd)
|
||||
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
|
||||
address = socket_helper.create_unix_domain_name()
|
||||
self.addCleanup(os_helper.unlink, address)
|
||||
socket_helper.bind_unix_socket(sock, address)
|
||||
|
||||
socket.send_fds(sock, [MSG], [rfd], 0, address)
|
||||
|
||||
# request more data and file descriptors than expected
|
||||
msg, (rfd2,), flags, addr = socket.recv_fds(sock, len(MSG) * 2, 2)
|
||||
self.addCleanup(os.close, rfd2)
|
||||
self.assertEqual(msg, MSG)
|
||||
self.assertEqual(flags, 0)
|
||||
self.assertEqual(addr, address)
|
||||
|
||||
# test that the file descriptor is connected
|
||||
os.write(wfd, b'data')
|
||||
data = os.read(rfd2, 100)
|
||||
self.assertEqual(data, b'data')
|
||||
|
||||
|
||||
class FreeThreadingTests(unittest.TestCase):
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Fix :func:`socket.send_fds` ignoring flags and address parameters.
|
Loading…
Add table
Add a link
Reference in a new issue