diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-07-19 15:55:53 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-07-19 15:55:53 +0400 |
commit | 6253cd5c8e1b482d78881282f3d2a271b63d1a33 (patch) | |
tree | e0c0807208fb2c103a43c89e39f4fd4ba4ca47c8 /src/Network/BitTorrent | |
parent | 22a3557ed14008a655d20ad216db22134442ed5b (diff) |
+ Add torrent group operations.
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r-- | src/Network/BitTorrent/Sessions.hs | 6 |
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 | ||
309 | unregisterTorrent :: TVar TorrentMap -> InfoHash -> IO () | 309 | -- TODO kill sessions |
310 | unregisterTorrent = error "unregisterTorrent" | 310 | unregisterTorrent :: ClientSession -> InfoHash -> IO () |
311 | unregisterTorrent ClientSession {..} ih = do | ||
312 | atomically $ modifyTVar' torrentMap $ HM.delete ih | ||
311 | 313 | ||
312 | getRegistered :: ClientSession -> IO TorrentMap | 314 | getRegistered :: ClientSession -> IO TorrentMap |
313 | getRegistered ClientSession {..} = readTVarIO torrentMap | 315 | getRegistered ClientSession {..} = readTVarIO torrentMap |