@@ -399,7 +399,7 @@ apiClose theirEndPoint connId connAlive = void . tryIO $ do
400 writeIORef connAlive False
400 writeIORef connAlive False
401 sendOn vst [encodeInt32 CloseConnection, encodeInt32 connId]
401 sendOn vst [encodeInt32 CloseConnection, encodeInt32 connId]
402− return (RemoteEndPointValid . (remoteOutgoing ^: (+ 1)) $ vst)
402+ return (RemoteEndPointValid . (remoteOutgoing ^: (\x -> x - 1)) $ vst)
404 return (RemoteEndPointValid vst)
404 return (RemoteEndPointValid vst)
405 RemoteEndPointClosed -> do
405 RemoteEndPointClosed -> do
@@ -598,7 +598,7 @@ requestConnectionTo ourEndPoint theirAddress = go
598 let failureHandler :: IOException -> IO b
598 let failureHandler :: IOException -> IO b
599 failureHandler err = do
599 failureHandler err = do
600 modifyMVar_ theirState $ \(RemoteEndPointValid ep) ->
600 modifyMVar_ theirState $ \(RemoteEndPointValid ep) ->
601− return (RemoteEndPointValid . (remoteOutgoing ^: (+ 1)) $ ep)
601+ return (RemoteEndPointValid . (remoteOutgoing ^: (\x -> x - 1)) $ ep)
602 -- TODO: should we call closeIfUnused here?
602 -- TODO: should we call closeIfUnused here?
603 throw $ TransportError ConnectFailed (show err)
603 throw $ TransportError ConnectFailed (show err)