summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-10-18 14:59:01 -0400
committerJoe Crayne <joe@jerkface.net>2020-01-01 19:56:52 -0500
commita3d4ea41c951fd6e53c0da51aa4136e780fe9a64 (patch)
tree9699315f6d67d5e0afa741966e7ff486490db716
parent811e3ec65c86694395b6c01409da62b6c0f8bf54 (diff)
Clean up "gc:bt-peers" thread.
-rw-r--r--dht/src/Network/BitTorrent/MainlineDHT.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/dht/src/Network/BitTorrent/MainlineDHT.hs b/dht/src/Network/BitTorrent/MainlineDHT.hs
index af618ba4..2ea2551e 100644
--- a/dht/src/Network/BitTorrent/MainlineDHT.hs
+++ b/dht/src/Network/BitTorrent/MainlineDHT.hs
@@ -659,13 +659,14 @@ newClient swarms addr = do
659 refresh_thread4 <- forkPollForRefresh $ refresher4 routing 659 refresh_thread4 <- forkPollForRefresh $ refresher4 routing
660 refresh_thread6 <- forkPollForRefresh $ refresher6 routing 660 refresh_thread6 <- forkPollForRefresh $ refresher6 routing
661 661
662 forkAnnouncedInfohashesGC (contactInfo swarms) 662 gc_peers <- forkAnnouncedInfohashesGC (contactInfo swarms)
663 663
664 return (client, routing, bootstrap (refresher4 routing), bootstrap (refresher6 routing) 664 return (client, routing, bootstrap (refresher4 routing), bootstrap (refresher6 routing)
665 , do killThread refresh_thread4 -- TODO: Better termination mechanism. 665 , do killThread refresh_thread4 -- TODO: Better termination mechanism.
666 killThread refresh_thread6 -- TODO: Better termination mechanism. 666 killThread refresh_thread6 -- TODO: Better termination mechanism.
667 atomically $ writeTChan addr4 Nothing -- Terminate "addr4" thread. 667 atomically $ writeTChan addr4 Nothing -- Terminate "addr4" thread.
668 atomically $ writeTChan addr6 Nothing -- Terminate "addr6" thread. 668 atomically $ writeTChan addr6 Nothing -- Terminate "addr6" thread.
669 killThread gc_peers
669 ) 670 )
670 671
671-- Note that you should call .put() every hour for content that you want to 672-- Note that you should call .put() every hour for content that you want to