summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r--src/Network/BitTorrent/Client.hs7
-rw-r--r--src/Network/BitTorrent/DHT.hs1
2 files changed, 3 insertions, 5 deletions
diff --git a/src/Network/BitTorrent/Client.hs b/src/Network/BitTorrent/Client.hs
index 7a50b6ba..349283c3 100644
--- a/src/Network/BitTorrent/Client.hs
+++ b/src/Network/BitTorrent/Client.hs
@@ -39,7 +39,6 @@ import Control.Exception
39import Control.Concurrent 39import Control.Concurrent
40import Control.Monad.Logger 40import Control.Monad.Logger
41import Control.Monad.Trans 41import Control.Monad.Trans
42import Control.Monad.Trans.Resource
43 42
44import Data.Default 43import Data.Default
45import Data.HashMap.Strict as HM 44import Data.HashMap.Strict as HM
@@ -84,15 +83,15 @@ exchangeOptions pid Options {..} = Exchange.Options
84 , optBacklog = optBacklog def 83 , optBacklog = optBacklog def
85 } 84 }
86 85
87--connHandler :: HashMap InfoHash Handle -> Handler 86connHandler :: MVar (HashMap InfoHash Handle) -> Exchange.Handler
88connHandler tmap = undefined 87connHandler _tmap = undefined
89 88
90newClient :: Options -> LogFun -> IO Client 89newClient :: Options -> LogFun -> IO Client
91newClient opts @ Options {..} logger = do 90newClient opts @ Options {..} logger = do
92 pid <- genPeerId 91 pid <- genPeerId
93 tmap <- newMVar HM.empty 92 tmap <- newMVar HM.empty
94 tmgr <- Tracker.newManager def (PeerInfo pid Nothing optPort) 93 tmgr <- Tracker.newManager def (PeerInfo pid Nothing optPort)
95 emgr <- Exchange.newManager (exchangeOptions pid opts) connHandler 94 emgr <- Exchange.newManager (exchangeOptions pid opts) (connHandler tmap)
96 node <- do 95 node <- do
97 node <- startNode defaultHandlers def optNodeAddr logger 96 node <- startNode defaultHandlers def optNodeAddr logger
98 runDHT node $ bootstrap (maybeToList optBootNode) 97 runDHT node $ bootstrap (maybeToList optBootNode)
diff --git a/src/Network/BitTorrent/DHT.hs b/src/Network/BitTorrent/DHT.hs
index cdc5124b..ed42363f 100644
--- a/src/Network/BitTorrent/DHT.hs
+++ b/src/Network/BitTorrent/DHT.hs
@@ -55,7 +55,6 @@ module Network.BitTorrent.DHT
55import Control.Applicative 55import Control.Applicative
56import Control.Monad.Logger 56import Control.Monad.Logger
57import Control.Monad.Reader 57import Control.Monad.Reader
58import Control.Monad.Trans
59import Control.Exception 58import Control.Exception
60import Data.ByteString as BS 59import Data.ByteString as BS
61import Data.Conduit as C 60import Data.Conduit as C