diff options
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r-- | src/Network/BitTorrent/DHT/Session.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Network/BitTorrent/DHT/Session.hs b/src/Network/BitTorrent/DHT/Session.hs index 263b88ac..a4f10bb1 100644 --- a/src/Network/BitTorrent/DHT/Session.hs +++ b/src/Network/BitTorrent/DHT/Session.hs | |||
@@ -66,18 +66,16 @@ import Data.Hashable | |||
66 | import Data.List as L | 66 | import Data.List as L |
67 | import Data.Monoid | 67 | import Data.Monoid |
68 | import Data.Text as T | 68 | import Data.Text as T |
69 | import Data.Text.Encoding as T | ||
70 | import Data.Time | 69 | import Data.Time |
71 | import Data.Time.Clock.POSIX | 70 | import Data.Time.Clock.POSIX |
72 | import System.Log.FastLogger | 71 | import System.Log.FastLogger |
73 | import System.Random (randomIO) | 72 | import System.Random (randomIO) |
74 | import System.Timeout.Lifted | ||
75 | import Text.PrettyPrint as PP hiding ((<>)) | 73 | import Text.PrettyPrint as PP hiding ((<>)) |
76 | import Text.PrettyPrint.Class | 74 | import Text.PrettyPrint.Class |
77 | 75 | ||
78 | import Data.Torrent.InfoHash | 76 | import Data.Torrent.InfoHash |
79 | import Network.KRPC hiding (Options, def) | 77 | import Network.KRPC hiding (Options, def) |
80 | import qualified Network.KRPC as KRPC (Options, def) | 78 | import qualified Network.KRPC as KRPC (def) |
81 | import Network.BitTorrent.Core | 79 | import Network.BitTorrent.Core |
82 | import Network.BitTorrent.Core.PeerAddr as P | 80 | import Network.BitTorrent.Core.PeerAddr as P |
83 | import Network.BitTorrent.DHT.Message | 81 | import Network.BitTorrent.DHT.Message |
@@ -305,6 +303,7 @@ insertNode info = fork $ do | |||
305 | -- Peer storage | 303 | -- Peer storage |
306 | -----------------------------------------------------------------------} | 304 | -----------------------------------------------------------------------} |
307 | 305 | ||
306 | -- TODO limit dht peer store in size (probably by removing oldest peers) | ||
308 | insertPeer :: Eq ip => InfoHash -> PeerAddr ip -> DHT ip () | 307 | insertPeer :: Eq ip => InfoHash -> PeerAddr ip -> DHT ip () |
309 | insertPeer ih addr = do | 308 | insertPeer ih addr = do |
310 | var <- asks contactInfo | 309 | var <- asks contactInfo |