git.iko.soy/distributed-process
on master help sign in
Remove potential race condition
commitb76094b908620a91397e198dd03b092eb689a226 authorEdsko de Vries <edsko@edsko.net> dateWed 16 May 2012, 15:51 (14 years ago) parent7926074
1 file changed+1−1
network-transport/src/Network/Transport/TCP.hs+1−1
network-transport/src/Network/Transport/TCP.hs+1−1
@@ -864,11 +864,11 @@ handleConnectionRequest transport sock = handle tryCloseSocket $ do
864864 , _remoteIncoming = IntSet.empty
865865 , sendOn = sendMany sock
866866 }
867+ sendMany sock [encodeInt32 ConnectionRequestAccepted]
867868 -- TODO: this putMVar might block if the remote endpoint sends a
868869 -- connection request for a local endpoint that it is already
869870 -- connected to
870871 putMVar (remoteState theirEndPoint) (RemoteEndPointValid vst)
871− sendMany sock [encodeInt32 ConnectionRequestAccepted]
872872 return (Just theirEndPoint)
873873 -- If we left the scope of the exception handler with a return value of
874874 -- Nothing then the socket is already closed; otherwise, the socket has