summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Client.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-24 14:23:58 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-24 14:23:58 +0400
commit2c7eb149a09df0349137dc518569310d8dea1461 (patch)
tree04d9fb840e41e5e27ef84ef69cfacb50b43a7346 /src/Network/BitTorrent/Client.hs
parentbe9c82cd6d3351d02e5f944f041837709d97fa39 (diff)
Simplify exchange manager handler
Diffstat (limited to 'src/Network/BitTorrent/Client.hs')
-rw-r--r--src/Network/BitTorrent/Client.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/Client.hs b/src/Network/BitTorrent/Client.hs
index bd4993ba..fce8cfe2 100644
--- a/src/Network/BitTorrent/Client.hs
+++ b/src/Network/BitTorrent/Client.hs
@@ -84,7 +84,11 @@ exchangeOptions pid Options {..} = Exchange.Options
84 } 84 }
85 85
86connHandler :: MVar (HashMap InfoHash Handle) -> Exchange.Handler 86connHandler :: MVar (HashMap InfoHash Handle) -> Exchange.Handler
87connHandler _tmap = undefined 87connHandler tmap ih = do
88 m <- readMVar tmap
89 case HM.lookup ih m of
90 Nothing -> error "torrent not found"
91 Just (Handle {..}) -> return exchange
88 92
89initClient :: Options -> LogFun -> ResIO Client 93initClient :: Options -> LogFun -> ResIO Client
90initClient opts @ Options {..} logFun = do 94initClient opts @ Options {..} logFun = do