File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3572,6 +3572,33 @@ def _testSendmsgAfterClose(self):
35723572class SendmsgStreamTests (SendmsgTests ):
35733573 # Tests for sendmsg() which require a stream socket and do not
35743574 # involve recvmsg() or recvmsg_into().
3575+ @unittest .skipUnless (hasattr (socket .socket , "sendmsg" ),
3576+ "sendmsg not supported" )
3577+ def _test_sendmsg_reentrant_ancillary_mutation (self ):
3578+ import socket
3579+
3580+ seq = []
3581+
3582+ class Mut :
3583+ def __init__ (self ):
3584+ self .tripped = False
3585+ def __index__ (self ):
3586+ if not self .tripped :
3587+ self .tripped = True
3588+ seq .clear ()
3589+ return 0
3590+
3591+ seq [:] = [
3592+ (socket .SOL_SOCKET , Mut (), b'x' ),
3593+ (socket .SOL_SOCKET , 0 , b'x' ),
3594+ ]
3595+
3596+ left , right = socket .socketpair ()
3597+ self .addCleanup (left .close )
3598+ self .addCleanup (right .close )
3599+
3600+ with self .assertRaises (Exception ):
3601+ left .sendmsg ([b'x' ], seq )
35753602
35763603 def testSendmsgExplicitNoneAddr (self ):
35773604 # Check that peer address can be specified as None.
You can’t perform that action at this time.
0 commit comments