summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Client/Handle.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-03-05 00:35:47 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-03-05 00:35:47 +0400
commit3c7f12c10caca196a970c0cc8b6c46945c9dee58 (patch)
treee5a4f8d2d29828ecee64c18881322a3cb7602b93 /src/Network/BitTorrent/Client/Handle.hs
parent6794c6843e625a3b61fec48e54167a13f5fd093b (diff)
Minor refactoring
Diffstat (limited to 'src/Network/BitTorrent/Client/Handle.hs')
-rw-r--r--src/Network/BitTorrent/Client/Handle.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Network/BitTorrent/Client/Handle.hs b/src/Network/BitTorrent/Client/Handle.hs
index e7ac779c..e7884caa 100644
--- a/src/Network/BitTorrent/Client/Handle.hs
+++ b/src/Network/BitTorrent/Client/Handle.hs
@@ -110,12 +110,12 @@ start Handle {..} = do
110 Client {..} <- getClient 110 Client {..} <- getClient
111 liftIO $ Tracker.notify trackerManager trackers Tracker.Started 111 liftIO $ Tracker.notify trackerManager trackers Tracker.Started
112 unless private $ do 112 unless private $ do
113 liftDHT $ DHT.insert topic undefined 113 liftDHT $ DHT.insert topic (error "start")
114 liftIO $ do 114 liftIO $ do
115 peers <- askPeers trackerManager trackers 115 peers <- askPeers trackerManager trackers
116 print $ "got: " ++ show (L.length peers) ++ " peers" 116 print $ "got: " ++ show (L.length peers) ++ " peers"
117 forM_ peers $ \ peer -> do 117 forM_ peers $ \ peer -> do
118 Exchange.insert peer exchange 118 Exchange.connect peer exchange
119 119
120-- | Stop downloading this torrent. 120-- | Stop downloading this torrent.
121pause :: Handle -> BitTorrent () 121pause :: Handle -> BitTorrent ()
@@ -126,7 +126,7 @@ stop :: Handle -> BitTorrent ()
126stop Handle {..} = do 126stop Handle {..} = do
127 Client {..} <- getClient 127 Client {..} <- getClient
128 unless private $ do 128 unless private $ do
129 liftDHT $ DHT.delete topic undefined 129 liftDHT $ DHT.delete topic (error "stop")
130 liftIO $ Tracker.notify trackerManager trackers Tracker.Stopped 130 liftIO $ Tracker.notify trackerManager trackers Tracker.Stopped
131 131
132{----------------------------------------------------------------------- 132{-----------------------------------------------------------------------