diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-24 14:23:58 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-24 14:23:58 +0400 |
commit | 2c7eb149a09df0349137dc518569310d8dea1461 (patch) | |
tree | 04d9fb840e41e5e27ef84ef69cfacb50b43a7346 /src/Network/BitTorrent/Client.hs | |
parent | be9c82cd6d3351d02e5f944f041837709d97fa39 (diff) |
Simplify exchange manager handler
Diffstat (limited to 'src/Network/BitTorrent/Client.hs')
-rw-r--r-- | src/Network/BitTorrent/Client.hs | 6 |
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 | ||
86 | connHandler :: MVar (HashMap InfoHash Handle) -> Exchange.Handler | 86 | connHandler :: MVar (HashMap InfoHash Handle) -> Exchange.Handler |
87 | connHandler _tmap = undefined | 87 | connHandler 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 | ||
89 | initClient :: Options -> LogFun -> ResIO Client | 93 | initClient :: Options -> LogFun -> ResIO Client |
90 | initClient opts @ Options {..} logFun = do | 94 | initClient opts @ Options {..} logFun = do |