diff options
-rw-r--r-- | src/Network/Tox.hs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/Network/Tox.hs b/src/Network/Tox.hs index d81ed1e3..515f155d 100644 --- a/src/Network/Tox.hs +++ b/src/Network/Tox.hs | |||
@@ -514,11 +514,11 @@ dnssdDiscover tox ni toxid = do | |||
514 | 514 | ||
515 | forkTox :: Tox extra -> Bool -> IO (IO (), [NodeInfo] -> [NodeInfo] -> IO (), [NodeInfo] -> [NodeInfo] -> IO ()) | 515 | forkTox :: Tox extra -> Bool -> IO (IO (), [NodeInfo] -> [NodeInfo] -> IO (), [NodeInfo] -> [NodeInfo] -> IO ()) |
516 | forkTox tox with_avahi = do | 516 | forkTox tox with_avahi = do |
517 | _ <- forkListener "toxHandshakes" (toxHandshakes tox) | 517 | quitHs <- forkListener "toxHandshakes" (toxHandshakes tox) |
518 | _ <- forkListener "toxToRoute" (toxToRoute tox) | 518 | quitToRoute <- forkListener "toxToRoute" (toxToRoute tox) |
519 | _ <- forkListener "toxOnion" (clientNet $ toxOnion tox) | 519 | quitOnion <- forkListener "toxOnion" (clientNet $ toxOnion tox) |
520 | _ <- forkListener "toxDHT" (clientNet $ toxDHT tox) | 520 | quitDHT <- forkListener "toxDHT" (clientNet $ toxDHT tox) |
521 | quit <- forkListener "toxCrypto" (toxCrypto tox) | 521 | quitNC <- forkListener "toxCrypto" (toxCrypto tox) |
522 | quitAvahi <- if with_avahi then do | 522 | quitAvahi <- if with_avahi then do |
523 | forkPollForRefresh (DHT.refresher4 $ toxRouting tox) | 523 | forkPollForRefresh (DHT.refresher4 $ toxRouting tox) |
524 | forkPollForRefresh (DHT.refresher6 $ toxRouting tox) | 524 | forkPollForRefresh (DHT.refresher6 $ toxRouting tox) |
@@ -529,7 +529,13 @@ forkTox tox with_avahi = do | |||
529 | return $ forM_ [dnssdIn,dnssdOut] killThread | 529 | return $ forM_ [dnssdIn,dnssdOut] killThread |
530 | else return $ return () | 530 | else return $ return () |
531 | keygc <- Onion.forkAnnouncedKeysGC (toxAnnouncedKeys tox) | 531 | keygc <- Onion.forkAnnouncedKeysGC (toxAnnouncedKeys tox) |
532 | return ( quitAvahi >> killThread keygc >> quit | 532 | return ( do quitAvahi |
533 | killThread keygc | ||
534 | quitNC | ||
535 | quitDHT | ||
536 | quitOnion | ||
537 | quitToRoute | ||
538 | quitHs | ||
533 | , bootstrap (DHT.refresher4 $ toxRouting tox) | 539 | , bootstrap (DHT.refresher4 $ toxRouting tox) |
534 | , bootstrap (DHT.refresher6 $ toxRouting tox) | 540 | , bootstrap (DHT.refresher6 $ toxRouting tox) |
535 | ) | 541 | ) |