diff options
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r-- | src/Network/BitTorrent/Client.hs | 7 | ||||
-rw-r--r-- | src/Network/BitTorrent/DHT.hs | 1 |
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 | |||
39 | import Control.Concurrent | 39 | import Control.Concurrent |
40 | import Control.Monad.Logger | 40 | import Control.Monad.Logger |
41 | import Control.Monad.Trans | 41 | import Control.Monad.Trans |
42 | import Control.Monad.Trans.Resource | ||
43 | 42 | ||
44 | import Data.Default | 43 | import Data.Default |
45 | import Data.HashMap.Strict as HM | 44 | import 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 | 86 | connHandler :: MVar (HashMap InfoHash Handle) -> Exchange.Handler |
88 | connHandler tmap = undefined | 87 | connHandler _tmap = undefined |
89 | 88 | ||
90 | newClient :: Options -> LogFun -> IO Client | 89 | newClient :: Options -> LogFun -> IO Client |
91 | newClient opts @ Options {..} logger = do | 90 | newClient 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 | |||
55 | import Control.Applicative | 55 | import Control.Applicative |
56 | import Control.Monad.Logger | 56 | import Control.Monad.Logger |
57 | import Control.Monad.Reader | 57 | import Control.Monad.Reader |
58 | import Control.Monad.Trans | ||
59 | import Control.Exception | 58 | import Control.Exception |
60 | import Data.ByteString as BS | 59 | import Data.ByteString as BS |
61 | import Data.Conduit as C | 60 | import Data.Conduit as C |