File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed
ouroboros-network-framework/src/Ouroboros/Network/ConnectionManager Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ module Ouroboros.Network.ConnectionManager.ConnMap
1717 , lookup
1818 , lookupByRemoteAddr
1919 , updateLocalAddr
20- , traverseMaybeWithKey
20+ , traverseMaybe
2121 ) where
2222
2323import Prelude hiding (lookup )
@@ -248,22 +248,17 @@ updateLocalAddr ConnectionId { remoteAddress, localAddress } (ConnMap m) =
248248 m
249249
250250
251- traverseMaybeWithKey
251+ traverseMaybe
252252 :: Applicative f
253- => (Either peerAddr ( ConnectionId peerAddr ) -> a -> f (Maybe b ))
253+ => (a -> f (Maybe b ))
254254 -> ConnMap peerAddr a
255255 -> f [b ]
256- traverseMaybeWithKey fn =
256+ traverseMaybe fn =
257257 fmap (concat . Map. elems)
258258 . Map. traverseMaybeWithKey
259- (\ remoteAddress st ->
259+ (\ _ st ->
260260 fmap (Just . Map. elems)
261- . Map. traverseMaybeWithKey
262- (\ case
263- UnknownLocalAddr -> fn (Left remoteAddress)
264- LocalAddr localAddress -> fn (Right ConnectionId { remoteAddress,
265- localAddress })
266- )
261+ . Map. traverseMaybeWithKey (\ _ -> fn)
267262 $ st
268263 )
269264 . getConnMap
Original file line number Diff line number Diff line change @@ -528,9 +528,8 @@ with args@Arguments {
528528 -- Spawning one thread for each connection cleanup avoids spending time
529529 -- waiting for locks and cleanup logic that could delay closing the
530530 -- connections and making us not respecting certain timeouts.
531- asyncs <- State. traverseMaybeWithKey
532- -- TODO: remove first argument!
533- (\ _peerAddrOrConnId MutableConnState { connStateId, connVar } -> do
531+ asyncs <- State. traverseMaybe
532+ (\ MutableConnState { connStateId, connVar } -> do
534533 -- cleanup handler for that thread will close socket associated
535534 -- with the thread. We put each connection in 'TerminatedState' to
536535 -- try that none of the connection threads will enter
You can’t perform that action at this time.
0 commit comments