mirror of https://github.com/voidlizard/hbs2
fixed? tcp pex
This commit is contained in:
parent
351ac97d44
commit
4d756d6eaf
|
@ -709,14 +709,13 @@ runPeer opts = U.handle (\e -> myException e
|
||||||
rcw <- async $ liftIO $ runRefChanRelyWorker rce refChanAdapter
|
rcw <- async $ liftIO $ runRefChanRelyWorker rce refChanAdapter
|
||||||
|
|
||||||
let pexFilt pips = do
|
let pexFilt pips = do
|
||||||
tcpex <- listTCPPexCandidates @e brains <&> HashSet.fromList
|
tcpex <- listTCPPexCandidates @e brains -- <&> HashSet.fromList
|
||||||
fset <- forM pips $ \p -> do
|
pips2 <- filter onlyUDP <$> mapM toPeerAddr pips
|
||||||
toPeerAddr p >>= \case
|
pure (L.nub (pips2 <> tcpex))
|
||||||
(L4Address UDP _) -> pure $ Just p
|
where
|
||||||
pa@(L4Address TCP _) | HashSet.member pa tcpex -> pure $ Just p
|
onlyUDP = \case
|
||||||
_ -> pure Nothing
|
(L4Address UDP _) -> True
|
||||||
|
_ -> False
|
||||||
pure (catMaybes fset)
|
|
||||||
|
|
||||||
let onNoBlock (p, h) = do
|
let onNoBlock (p, h) = do
|
||||||
already <- liftIO $ Cache.lookup nbcache (p,h) <&> isJust
|
already <- liftIO $ Cache.lookup nbcache (p,h) <&> isJust
|
||||||
|
|
Loading…
Reference in New Issue