summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-07-19 15:55:53 +0400
committerSam T <pxqr.sta@gmail.com>2013-07-19 15:55:53 +0400
commit6253cd5c8e1b482d78881282f3d2a271b63d1a33 (patch)
treee0c0807208fb2c103a43c89e39f4fd4ba4ca47c8 /src/Network/BitTorrent
parent22a3557ed14008a655d20ad216db22134442ed5b (diff)
+ Add torrent group operations.
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r--src/Network/BitTorrent/Sessions.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Sessions.hs b/src/Network/BitTorrent/Sessions.hs
index 4e58be5c..6b73dd6c 100644
--- a/src/Network/BitTorrent/Sessions.hs
+++ b/src/Network/BitTorrent/Sessions.hs
@@ -306,8 +306,10 @@ registerTorrent ClientSession {..} loc @ TorrentLoc {..} = do
306 torrent <- fromFile metafilePath 306 torrent <- fromFile metafilePath
307 atomically $ modifyTVar' torrentMap $ HM.insert (tInfoHash torrent) loc 307 atomically $ modifyTVar' torrentMap $ HM.insert (tInfoHash torrent) loc
308 308
309unregisterTorrent :: TVar TorrentMap -> InfoHash -> IO () 309-- TODO kill sessions
310unregisterTorrent = error "unregisterTorrent" 310unregisterTorrent :: ClientSession -> InfoHash -> IO ()
311unregisterTorrent ClientSession {..} ih = do
312 atomically $ modifyTVar' torrentMap $ HM.delete ih
311 313
312getRegistered :: ClientSession -> IO TorrentMap 314getRegistered :: ClientSession -> IO TorrentMap
313getRegistered ClientSession {..} = readTVarIO torrentMap 315getRegistered ClientSession {..} = readTVarIO torrentMap