diff options
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 |